全局属性的设置 <?xml version="1.0"encoding="utf-8"?> <TableLayout mlns:android="http:/事示笪n回伸屁 d.com/apk/res/android" android:layout wid 丰云陷逝正右行 android:layout 表示第1、2列皆可收缩 ent" android:stretd android:collapsecolumns="*" android:shrinkColumns="1,2"> </TableLayout> 列可以同时具备stretchColumns和shrinkColumns属性;当该列的内容较多时 注意 将以“多行”方式显示其内容。 Android软件开发 主讲:王海
Android软件开发 主讲:王海 全局属性的设置 <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns="0" android:collapseColumns="*" android:shrinkColumns="1,2" > </TableLayout> stretchColumns shrinkColumns 0 1 2
·使用TableRow.LayoutParams对TableRow的子元素进行修饰 XML属性 功能描述 android:layout column 指定该单元格在第几列显示 android:layout_span 指定该单元格占据的列数(未指定时,默认为) ·对表格属性进行设置 <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns="0" android:collapseColumns="*" android:shrinkCo 丰云拉垃出上显 <TableRow> 表示该控件显示在第1列 <Button android: <Button android:layout column="1"/> </TableRow> </TableLayout> Android软件开发 主讲:王海
Android软件开发 主讲:王海 • 使用TableRow.LayoutParams对TableRow的子元素进行修饰 • 对表格属性进行设置 <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns="0" android:collapseColumns="*" android:shrinkColumns="1,2" > <TableRow> <Button android:layout_span="2"/> <Button android:layout_column="1"/> </TableRow> </TableLayout> XML属性 功能描述 android:layout_column android:layout_span 1 2 1