android所有布局

来源:互联网 发布:在线ps网站源码 编辑:程序博客网 时间:2024/05/21 18:49

    1.LinearLayout 线性布局

i. gravity当前控件内容显示位置

ii. layout_gravity当前控件在父控件的位置

2.RelativeLayout 相对布局

i. layout_centerhorizontal水平剧中

ii. layout_alignPatrntRight在父控件右边

iii. layout_above在另外一个控件上边

iv. layout_alighTop与另一个控件顶端对齐

3.FrameLayout 帧布局

i. Layout_gravity设置控件在父控件的相对位置

4.AbstractLayout 绝对布局

i. Layout_x

5.TableLayout 表格布局

i. 一般与tableRow配套使用

ii. stretchColummes拉伸列

iii. ShrinkColunmes收缩列

iv. Collapsecolumse隐藏列

v. Layout_span合并列

 

6.PercentRelativeLayout  

i. 现在build.gradledependence{

compilecom.android.support:percent:23.4.0}

ii. 设置子控件所占整个屏幕的百分比绘制控件

.xml文件设置命名空间

xml:lee=“http://schemas.android.com/apk/res-auto”

iii. 设置子控件宽高

a) lee:layout_heightPercent=30%

    7.PercentFrameLayout

0 0
原创粉丝点击