国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Android > 正文

Android布局之表格布局TableLayout詳解

2019-10-22 18:26:01
字體:
來源:轉載
供稿:網友

本文實例為大家分享了Android表格布局TableLayout的具體代碼,供大家參考,具體內容如下

1.TableLayout

TableLayout表格布局模型以行列的形式管理子控件,每一行為一個TableRow的對象, 當然也可以使一個View的對象

2.TableLayout的屬性(全局屬性)

android:collapseColumns=”1,2”
隱藏從0開始的索引列,列之間必須用逗號隔開1,2
android:shrinkColumns=”1,2”
收縮從0開始的索引列,當可收縮的列太寬(內容太多時)不會被擠出屏幕,列之間
用逗號隔開1,2,你可以通過”*”代替收縮所有列,注意一列能同時表示收縮和拉伸
android:stretchColumns=”1,2”
拉伸從0開始的索引列,以填滿剩下的多余空白空間,列之間必須用逗號隔開,1,2,
你可以通過”*”代替收縮所有列,注意一列能同時表示收縮和拉伸

3.TableLayout的局部屬性(內部控件所用屬性)

android:layout_column=”1” 該控件顯示在第1列
android:layout_span=”2” 該控件占據兩列

<?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:collapseColumns="0" android:shrinkColumns="4"> <TableRow  android:id="@+id/tablerow1"  android:layout_width="wrap_content"  android:layout_height="wrap_content" >  <Button   android:id="@+id/button4"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:text="Button1" />  <Button   android:id="@+id/button5"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:text="Button2" />  <Button   android:id="@+id/button6"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:text="Button3" />  <Button   android:id="@+id/button7"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:text="Button4" />  <Button   android:id="@+id/button8"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:text="Button555555555555555555555555" /> </TableRow></TableLayout>

Android,表格布局,TableLayout

<?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="*"> <TableRow  android:id="@+id/tablerow1"  android:layout_width="match_parent"  android:layout_height="match_parent">  <Button   android:id="@+id/button4"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:text="Button1" />  <Button   android:id="@+id/button5"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:text="Button2" />  <Button   android:id="@+id/button6"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:text="Button3" /> </TableRow></TableLayout>

Android,表格布局,TableLayout

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持VEVB武林網。


注:相關教程知識閱讀請移步到Android開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 营口市| 延安市| 邢台市| 本溪市| 云霄县| 磴口县| 怀化市| 广水市| 新平| 淳安县| 颍上县| 龙海市| 肃南| 五华县| 临西县| 阳西县| 元朗区| 前郭尔| 阳新县| 柞水县| 杭锦旗| 林口县| 湖北省| 阳东县| 双流县| 鹤山市| 阳谷县| 南充市| 徐闻县| 汪清县| 巴中市| 湾仔区| 陇南市| 白河县| 陕西省| 克东县| 丰台区| 陆丰市| 金阳县| 灵宝市| 百色市|