转载注明出处:
http://blog.csdn.net/eana_don/article/details/8362744
资料参考:官网API
资料参考:官网API
TableLayout 为表格布局。将屏幕分为一个个表格。使用TableRow作为行来区分,没有TableColumn这样的东西。它会将包含在TableRow里的东西自动根据控件个数做列的对应。而列的宽度由所有行中列最宽的控件决定宽度。
一、TableLayout常用的属性:
android:stretchColumns:指定列拉伸,当屏幕有剩余的空间时,用指定的列充满其余控件
android:shrinkColumns:指定自动收缩列,只有在长度超过屏幕时起作用,当控件长度超过屏幕时,指定的列将收缩到适应屏幕的宽度
android:layout_column:指定跳过第几列不填
android:layout_span:指定一个控件跨几行。默认为1
二、xml布局写法:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
andr