表格版面配置tabelLayout,布局tabellayout

來源:互聯網
上載者:User

表格版面配置tabelLayout,布局tabellayout
表格版面配置tabelLayout

一、簡介

 

二、執行個體

<!-- 這個tableRow裡面有兩個組件,所以是兩列 -->
<!-- 這個tableRow裡面有三個組件,所以是三列 -->

 

 1 <?xml version="1.0" encoding="utf-8"?> 2 <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 3     android:layout_width="match_parent" 4     android:layout_height="match_parent" > 5      6     <!-- 表格版面配置主要有tablerow屬性,要幾列就在裡面添加幾個控制項即可 --> 7     <TableRow 8          android:layout_width="match_parent" 9          android:layout_height="wrap_content"10         >11         <!-- 這個tableRow裡面有兩個組件,所以是兩列 -->12         <TextView13             android:layout_width="wrap_content"14             android:layout_height="wrap_content"15             android:text="1"16             android:layout_weight="1"17             android:gravity="center_horizontal" 18             android:textSize="50sp"19             />20         <TextView21             android:layout_width="wrap_content"22             android:layout_height="wrap_content"23             android:text="2"24             android:layout_weight="1"25             android:gravity="center_horizontal" 26             android:textSize="50sp"27             />28     </TableRow>29     30     <!-- 第二行 -->31     <TableRow32          android:layout_width="match_parent"33          android:layout_height="wrap_content"34         >35         <!-- 這個tableRow裡面有三個組件,所以是三列 -->36         <TextView37             android:layout_width="wrap_content"38             android:layout_height="wrap_content"39             android:text="21"40             android:layout_weight="1"41             android:gravity="center_horizontal" 42             android:textSize="50sp"43             />44         <TextView45             android:layout_width="wrap_content"46             android:layout_height="wrap_content"47             android:text="22"48             android:layout_weight="1"49             android:gravity="center_horizontal" 50             android:textSize="50sp"51             />52         <TextView53             android:layout_width="wrap_content"54             android:layout_height="wrap_content"55             android:text="23"56             android:layout_weight="1"57             android:gravity="center_horizontal" 58             android:textSize="50sp"59             />60     </TableRow>61     62 63 </TableLayout>

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.