LinearLayout 线性布局 ---分水平和垂直
TableLayout
FrameLayout 单帧布局 --- 控件会重叠
dip: device independent pixels 设备独立像素
tablelayout例子:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1" > 从0开始数,对某column实施自动施展
<TableRow>
<TextView
android:text="@string/hello"
android:background="#aa0000"
android:padding="3dip"
/>
<TextView
android:text="@string/hello"
android:background="#006600"
android:gravity="center_horizontal" 字体居中
android:padding="3dip"
/>
<TextView
android:text="@string/hello"
android:background="#0000aa"
android:padding="3dip"
/>
</TableRow>
</TableLayout>
显示效果
===========================================
关于RelativeLayout:
TableLayout
FrameLayout 单帧布局 --- 控件会重叠
dip: device independent pixels 设备独立像素
tablelayout例子:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1" > 从0开始数,对某column实施自动施展
<TableRow>
<TextView
android:text="@string/hello"
android:background="#aa0000"
android:padding="3dip"
/>
<TextView
android:text="@string/hello"
android:background="#006600"
android:gravity="center_horizontal" 字体居中
android:padding="3dip"
/>
<TextView
android:text="@string/hello"
android:background="#0000aa"
android:padding="3dip"
/>
</TableRow>
</TableLayout>
显示效果
===========================================
关于RelativeLayout: