Android layout layout_weight属性理解
来源:互联网 发布:萝卜游侠网络 编辑:程序博客网 时间:2024/06/07 05:34
一,android layout属性介绍:
Android有4种Layout:FrameLayout,LinearLayout,TableLayout,RelativeLayout。
放入Layout中进行排布的View的XML属性:
4种Layout中Item所共有的XML属性:
(1)layout_width
(2)layout_height
(3)layout_marginLeft
(4)layout_marginTop
(5)layout_marginRight
(6)layout_marginBottom
(7)layout_gravity
FrameLayout中的Item就具有这些属性。
对于LinearLayout还会有
(8)layout_weight
TableLayout的行TableRow是一个横向的(horizontal)的LinearLayout。
RelativeLayout有16个align相关的XML属性。
(9)layout_above
(10)layout_alignBaseline
(11)layout_alignBottom
(12)layout_alignLeft
(13)layout_alignParentBottom
(14)layout_alignParentLeft
(15)layout_alignParentRight
(16)layout_alignParentTop
(17)layout_alignRight
(18)layout_alignTop
(19)layout_below
(20)layout_centerHorizontal
(21)layout_centerInParent
(22)layout_centerVertical
(23)layout_toLeftOf
(24)layout_toRightOf
(1)和(2)用来确定放入Layout中的View的宽度和高度:它们的可能取值为fill_parent,wrap_content或者固定的像素值。
(3)(4)(5)(6)是放入Layout中的View期望它能够和Layout的边界或者其他View之间能够相距一段距离。
(7)用来确定View在Layout中的停靠位置。
(8)用于在LinearLayout中把所有子View排布之后的剩余空间按照它们的layout_weight分配给各个拥有这个属性的View。
(9)到(24)用来确定RelativeLayout中的View相对于Layout或者Layout中的其他View的位置。
二,layout_weight属性介绍
该属性一般都应用在LinearLayout中,在控件的layout_width值为fill_parent的时候,多个设置了wight属性的控件,weight的值越小,其站的控件越大。如果width值为
wrap_content,则weight的值越小,站的控件越就越小。
但是在width值为wrap_content的时候,首先要保证控件的显示,weight分配的空间是在除了控件wrap_content所占空间外剩余的空间里按比例分配的。
- Android layout layout_weight属性理解
- android中layout的layout_weight属性介绍
- 对android的layout_weight属性的理解
- 对android的layout_weight属性的理解
- 深入理解layout_weight属性
- android之LinearLayout中android:layout_weight属性理解
- android---android:layout_weight属性
- android开发中LinearLayout中的Layout_weight属性的理解
- android:layout_weight属性你真的理解吗
- android layout_weight 属性
- android:layout_weight属性详解
- Android layout_weight属性
- android:layout_weight属性详解
- android:layout_weight属性探讨
- android:layout_weight属性详解
- Android layout_weight属性备忘
- android:layout_weight属性详解
- android:layout_weight属性讲解
- Struts学习笔记(一)
- 解决Chrome插件chrome.tabs无效的Bug
- 在ubuntu中安装 Source-Navigator及使用手册(zz)
- 开始写博客
- android 零散笔记不定期更新 v17
- Android layout layout_weight属性理解
- dojo.xhrPut
- telnet 实现HTTP协议
- wince自动生成XIP映像文件的一种方法
- Eclipse 下 swt designer安装方法
- servlet学习笔记
- CE6下兼容和非兼容位图的深入分析
- Jinja2 简明使用手册(转载)
- installShield for VC6.0生成一个EXE安装包