Android学习笔记之android:collapseColumns,android:shrinkColumns和stretchColumn
2013-11-25 14:23
393 查看
TableLayout是一个使用复杂的布局,最简单的用法就仅仅是拖拉控件做出个界面,但实际上,会经常在代码里使用TableLayout,例如做出表格的效果。本文主要介绍TableLayout的基本使用方法。
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1"
android:layout_column="0"/>
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button2"
android:layout_column="1"/>
</TableRow>
</TableLayout>
www.2cto.com
1 android:stretchColumns = "指定的列" ------->以第0行为序,尽量把指定的列填充空白部分
设置stretchColumns=0,则结果如下图,第0列被尽量填充
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1"
android:layout_column="0"/>
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button2"
android:layout_column="1"/>
</TableRow>
</TableLayout>
www.2cto.com
1 android:stretchColumns = "指定的列" ------->以第0行为序,尽量把指定的列填充空白部分
设置stretchColumns=0,则结果如下图,第0列被尽量填充
相关文章推荐
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- Android学习笔记之 android:collapseColumns ,android:shrinkColumns 和stretchColumns
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn --布局
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn
- Android学习笔记之 android:collapseColumns ,android:shrinkColumns 和stretchColumns
- android - TableLayout之android:collapseColumns ,android:shrinkColumns 和stretchColumns
- 安卓表格布局android:collapseColumns,android:shrinkColumns和stretchColumn .
- 安卓表格布局 collapseColumns,shrinkColumns和stretchColumn等属性使用