亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Android布局之表格布局TableLayout詳解

 更新時間:2017年10月12日 09:17:14   作者:海向_起源  
這篇文章主要為大家詳細介紹了Android布局之表格布局TableLayout,具有一定的參考價值,感興趣的小伙伴們可以參考一下

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

1.TableLayout

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

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

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

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

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

<?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>

這里寫圖片描述

<?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>

這里寫圖片描述

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

  • 淺析Android 快速實現(xiàn)圖片壓縮與上傳功能

    淺析Android 快速實現(xiàn)圖片壓縮與上傳功能

    在Android對手機相冊中的圖片的壓縮和上傳到服務器上,這樣的功能在每個app開發(fā)中都會有這樣的需求.所以今天就對android端怎么快速實現(xiàn)圖片壓縮和上傳進行簡單的分析
    2017-08-08
  • Flutter定義tabbar底部導航路由跳轉的方法

    Flutter定義tabbar底部導航路由跳轉的方法

    這篇文章主要為大家詳細介紹了Flutter定義tabbar底部導航路由跳轉的方法,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-07-07
  • Android開發(fā)中類加載器DexClassLoader的簡單使用講解

    Android開發(fā)中類加載器DexClassLoader的簡單使用講解

    這篇文章主要介紹了Android開發(fā)中類加載器DexClassLoader的簡單使用講解,DexClassLoader可以看作是一個特殊的Java中的ClassLoader,需要的朋友可以參考下
    2016-04-04
  • 分析CmProcess跨進程通信的實現(xiàn)

    分析CmProcess跨進程通信的實現(xiàn)

    CmProcess是Android一個跨進程通信框架,無需進行bindService()操作,不用定義Service,也不需要定義aidl。 支持IPC級的 Callback,并且支持跨進程的事件總線,可同步獲取服務,采用面向接口方式進行服務注冊與調(diào)用,服務調(diào)用方和使用者完全解耦
    2021-06-06
  • android gradle如何修改生成的apk名字

    android gradle如何修改生成的apk名字

    Gradle是當前非常“勁爆”得構建工具,而這篇文章主要給大家介紹了關于android gradle如何修改生成的apk名字的相關資料,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧。
    2017-12-12
  • Android?WebView開發(fā)之自定義WebView工具框

    Android?WebView開發(fā)之自定義WebView工具框

    在WebView頁面長按時會彈出一個復制框,有的時候里面的item不是我們想要,這個時候我們就可以自定義一個工具框。本文就將介紹如何通過WebView自定義工具框,需要的朋友可以參考一下
    2021-12-12
  • Android開發(fā)仿咸魚鍵盤DEMO(修改版)

    Android開發(fā)仿咸魚鍵盤DEMO(修改版)

    本文給大家分享一段代碼關于android開發(fā)高仿咸魚鍵盤修改版的實例代碼,代碼簡單易懂,非常實用,需要的朋友參考下吧
    2016-11-11
  • Android項目中實體類entity的作用詳解

    Android項目中實體類entity的作用詳解

    這篇文章主要介紹了Android項目中實體類entity的作用詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-04-04
  • Android 7.0系統(tǒng)webview 顯示https頁面空白處理方法

    Android 7.0系統(tǒng)webview 顯示https頁面空白處理方法

    今天小編就為大家分享一篇Android 7.0系統(tǒng)webview 顯示https頁面空白處理方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-07-07
  • Android開發(fā)實現(xiàn)圖片圓角的方法

    Android開發(fā)實現(xiàn)圖片圓角的方法

    這篇文章主要介紹了Android開發(fā)實現(xiàn)圖片圓角的方法,涉及Android針對圖形圖像的相關操作技巧,需要的朋友可以參考下
    2016-10-10

最新評論