android 学习

TableLayout(表格布局)

常用的三个属性

android:collapseColumns:设置需要被隐藏的列的序号
android:shrinkColumns:设置允许被收缩的列的列序号
android:stretchColumns:设置运行被拉伸的列的列序号

隐藏列

 1 <TableLayout  
 2     android:id="@+id/TableLayout2"  
 3     android:layout_width="fill_parent"  
 4     android:layout_height="wrap_content"  
 5     android:collapseColumns="0,2" >  
 6 
 7     <TableRow>  
 8 
 9         <Button  
10             android:layout_width="wrap_content"  
11             android:layout_height="wrap_content"  
12             android:text="one" />  
13 
14         <Button  
15             android:layout_width="wrap_content"  
16             android:layout_height="wrap_content"  
17             android:text="two" />  
18 
19         <Button  
20             android:layout_width="wrap_content"  
21             android:layout_height="wrap_content"  
22             android:text="three" />  
23 
24         <Button  
25             android:layout_width="wrap_content"  
26             android:layout_height="wrap_content"  
27             android:text="four" />  
28 
29         <Button  
30             android:layout_width="wrap_content"  
31             android:layout_height="wrap_content"  
32             android:text="five" />  
33     </TableRow>  
34 </TableLayout>
原文地址:https://www.cnblogs.com/Nojava/p/14907323.html