Android 表格佈局 TableLayout

来源:https://www.cnblogs.com/zhangxuechao/archive/2019/11/03/11787167.html
-Advertisement-
Play Games

屬性介紹stretchColumns:列被拉伸shrinkColumns:列被收縮collapseColumns:列被隱藏舉例測試 ... ...


屬性介紹

stretchColumns:列被拉伸

shrinkColumns:列被收縮

collapseColumns:列被隱藏

舉例測試

    <TableLayout
        android:id="@+id/table1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:stretchColumns="0" >

        <TableRow
            android:id="@+id/row1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:id="@+id/textView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#fd8d8d"
                android:text="測試表格佈局"
                android:textColor="#000000" />
        </TableRow>
    </TableLayout>

    <TableLayout
        android:id="@+id/table2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:shrinkColumns="0,1,2,3" >

        <TableRow
            android:id="@+id/row2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <Button
                android:id="@+id/button1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="button1" />

            <Button
                android:id="@+id/button2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="button2" />

            <Button
                android:id="@+id/button3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="button3" />

            <Button
                android:id="@+id/button4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="button4" />
        </TableRow>
    </TableLayout>

    <TableLayout
        android:id="@+id/table3"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:stretchColumns="0" >

        <TableRow
            android:id="@+id/row3"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <EditText
                android:id="@+id/editText"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="查詢" />
        </TableRow>
    </TableLayout>

image


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 現如今的互聯網世界里,代理服務已經十分常見,它通常作為一個第三方或者說中轉站角色替代用戶取得信息或者服務。 根據代理對象的不同,代理服務可以分為正向代理和反向代理。 ...
  • 認識 多表連接查詢 ,我感覺應該是關係型資料庫最能體現其價值和靈活性的地方吧. 我覺得資料庫的作用, 歸納起來無非就是 存儲和查詢 . 一言蔽之,資料庫就是能靈活地存儲和查詢數據. 存儲上, 也是以文件的方式存的(Linux觀點, 一切皆文件), 文件就是存儲數據的載體, 資料庫文件跟其他的數據文件 ...
  • 如果本地自己的電腦沒有安裝Oracle(伺服器端資料庫),那就要單獨安裝HA-Instant Client-v11.2.0.3.0.exe(oracle_client客戶端) 如果本地安裝了Oracle(伺服器端資料庫),就包含了HA-Instant Client-v11.2.0.3.0.exe,不 ...
  • 介紹數據倉庫的的定義及特征,數據倉庫常見的應用和數據倉庫系統的組成部分。 ...
  • 一、DDL、DML、DCL常用語句 1、DDL(Data Definition Language)資料庫定義語言 (1)資料庫模式定義 (2)表定義 2、DML(data manipulation language)資料庫操作語言 3、DCL(Data Control Language)資料庫控制語 ...
  • 一、SQL基本概念: SQL 已經成為關係資料庫的標準語言,是一種資料庫查詢和程式設計語言,用 於存取數據以及查詢、更新和管理關係資料庫系統。 功能不僅僅是查詢,還包括數據定義、數據操縱和數據控制等於資料庫有關的 一系列功能。 四大功能:數據查詢、數據定義、數據操縱和數據控制。 1)嵌入式和動態 S ...
  • @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().i... ...
  • @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present.// getMenuInflater()... ...
一周排行
    -Advertisement-
    Play Games
  • 前言 在我們開發過程中基本上不可或缺的用到一些敏感機密數據,比如SQL伺服器的連接串或者是OAuth2的Secret等,這些敏感數據在代碼中是不太安全的,我們不應該在源代碼中存儲密碼和其他的敏感數據,一種推薦的方式是通過Asp.Net Core的機密管理器。 機密管理器 在 ASP.NET Core ...
  • 新改進提供的Taurus Rpc 功能,可以簡化微服務間的調用,同時可以不用再手動輸出模塊名稱,或調用路徑,包括負載均衡,這一切,由框架實現並提供了。新的Taurus Rpc 功能,將使得服務間的調用,更加輕鬆、簡約、高效。 ...
  • 順序棧的介面程式 目錄順序棧的介面程式頭文件創建順序棧入棧出棧利用棧將10進位轉16進位數驗證 頭文件 #include <stdio.h> #include <stdbool.h> #include <stdlib.h> 創建順序棧 // 指的是順序棧中的元素的數據類型,用戶可以根據需要進行修改 ...
  • 前言 整理這個官方翻譯的系列,原因是網上大部分的 tomcat 版本比較舊,此版本為 v11 最新的版本。 開源項目 從零手寫實現 tomcat minicat 別稱【嗅虎】心有猛虎,輕嗅薔薇。 系列文章 web server apache tomcat11-01-官方文檔入門介紹 web serv ...
  • C總結與剖析:關鍵字篇 -- <<C語言深度解剖>> 目錄C總結與剖析:關鍵字篇 -- <<C語言深度解剖>>程式的本質:二進位文件變數1.變數:記憶體上的某個位置開闢的空間2.變數的初始化3.為什麼要有變數4.局部變數與全局變數5.變數的大小由類型決定6.任何一個變數,記憶體賦值都是從低地址開始往高地 ...
  • 如果讓你來做一個有狀態流式應用的故障恢復,你會如何來做呢? 單機和多機會遇到什麼不同的問題? Flink Checkpoint 是做什麼用的?原理是什麼? ...
  • C++ 多級繼承 多級繼承是一種面向對象編程(OOP)特性,允許一個類從多個基類繼承屬性和方法。它使代碼更易於組織和維護,並促進代碼重用。 多級繼承的語法 在 C++ 中,使用 : 符號來指定繼承關係。多級繼承的語法如下: class DerivedClass : public BaseClass1 ...
  • 前言 什麼是SpringCloud? Spring Cloud 是一系列框架的有序集合,它利用 Spring Boot 的開發便利性簡化了分散式系統的開發,比如服務註冊、服務發現、網關、路由、鏈路追蹤等。Spring Cloud 並不是重覆造輪子,而是將市面上開發得比較好的模塊集成進去,進行封裝,從 ...
  • class_template 類模板和函數模板的定義和使用類似,我們已經進行了介紹。有時,有兩個或多個類,其功能是相同的,僅僅是數據類型不同。類模板用於實現類所需數據的類型參數化 template<class NameType, class AgeType> class Person { publi ...
  • 目錄system v IPC簡介共用記憶體需要用到的函數介面shmget函數--獲取對象IDshmat函數--獲得映射空間shmctl函數--釋放資源共用記憶體實現思路註意 system v IPC簡介 消息隊列、共用記憶體和信號量統稱為system v IPC(進程間通信機制),V是羅馬數字5,是UNI ...