您的位置:首页 > 移动开发 > Android开发

Android ApiDemos示例解析(157):Views->Layouts->TableLayout->02. Empty Cells

2012-09-06 20:50 495 查看
本例介绍如何在TableLayout中使用空单元格,一种是跳过该单元格,一种是使用不可见的View占据某个单元格:

<TableLayout xmlns:android=”http://schemas.android.com/apk/res/android”

android:layout_width=”match_parent”

android:layout_height=”match_parent”>

<TableRow>

< Button

android:text=”@string/table_layout_2_open” />

<TextView

android:text=”@string/table_layout_2_path_1″

android:padding=”3dip” />

< /TableRow>

< TableRow>

< Button

android:text=”@string/table_layout_2_save_all”/>

< /TableRow>

< TableRow>

< Button

android:text=”@string/table_layout_2_save”

android:visibility=”invisible” />

<TextView

android:text=”@string/table_layout_2_path_2″

android:padding=”3dip” />

< /TableRow>

< /TableLayout>

本例第二行只定义了第一列的单元格,跳过了第二列,第三行要不显示第一列,可以使用一个不可见的View,android:visibility=”invisible”



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐