layout_weight属性的使用
2015-12-24 15:50
411 查看
<!-- 首先按照声明的尺寸进行分配,然后在根据 weight来分配 --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="48dip" android:orientation="horizontal" android:baselineAligned="false" android:weightSum="6" > <TextView android:gravity="center" android:background="#00ff00" android:layout_weight="1" android:layout_width="0dip" android:layout_height="match_parent" android:text="11111111111111111111" /> <TextView android:gravity="center" android:background="#ff0000" android:layout_weight="2" android:layout_width="0dip" android:layout_height="match_parent" android:text="2" /> <TextView android:gravity="center" android:background="#0000ff" android:text="3" android:layout_weight="3" android:layout_width="0dip" android:layout_height="match_parent" /> </LinearLayout>
相关文章推荐
- 增量更新对开发者有何影响?
- c++中关于hash_map自定义equal function和hash function
- (2.2)QCA atheros 无线配置命令——iwpriv关联和ACL
- HDU 1394 Minimum Inversion Number(树状数组||线段树)
- jqgrid列动态加载
- asp.net WebPages 速记3
- html、js实现facebook、twitter分享
- 十大编程算法助程序员走上高手之路
- xcode APP 打包以及提交itc审核详细流程
- 表达式(四则运算)计算的算法
- java.net.InetAddress类的使用
- (2.1)QCA atheros 无线配置命令——iwpriv聚合和ANI参数
- 【剑指offer】之青蛙跳台阶
- ActionBar
- 避开WebForm天坑,拥抱ASP.Net MVC吧
- 关于if/else if
- JS 特殊字符的魅力
- 关于sqoop与datax。 和sqoop to oracle插件OraOop
- JAVA虚拟机关闭钩子(Shutdown Hook)
- cocospod 安装问题