当前位置:操作系统 > 安卓/Android >>

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

本例介绍如何在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  www.zzzyk.com
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”

 \

补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,