android 中的UI

来源:互联网 发布:linux route del 编辑:程序博客网 时间:2024/05/29 15:40

2Android中的 UI

1.Common Layout(普通的常用布局)

 

1)RelativeLayout (相对布局)

相对位置的布局

 

2)LinearLayout (线性布局)

现行布局,从上到下或者从做到右, orientation vertica horizontal

android:layout_gravity="center_horizontal" (是指控件本身水平居中)

android:gravity="center_horizontal" (是指控件里的内容在该控件中水平居中)

 

3)GridLayout (网格布局)

GridLayout (网格类型的布局)

 

4)FrameLayout(帧布局)

若是不指定位置控件就会重叠,后面引用的控件会遮盖前面的控件。

android:layout_gravity="right|top 可以用这样的方式来指定控件的位置

5)Table Layout(表格布局)

Android:shrinkColumns="0, 1, 2"//每一行分三份

<TableRow> android:layout_column="0" </TableRow>//第一行的第一份

<TableRow>

<Button

android:layout_column="1" //第二行第二份 />

<Button

android:layout_column="1" //第二行第二份 />

</TableRow>

 

5)......(绝对布局)

这个布局基本上已经不推荐使用了


0 0