表格布局tabelLayout
2024-09-24 05:51:00
表格布局tabelLayout
一、简介
二、实例
<!-- 这个tableRow里面有两个组件,所以是两列 -->
<!-- 这个tableRow里面有三个组件,所以是三列 -->
<?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" > <!-- 表格布局主要有tablerow属性,要几列就在里面添加几个控件即可 -->
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<!-- 这个tableRow里面有两个组件,所以是两列 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textSize="50sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textSize="50sp"
/>
</TableRow> <!-- 第二行 -->
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<!-- 这个tableRow里面有三个组件,所以是三列 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="21"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textSize="50sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="22"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textSize="50sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="23"
android:layout_weight="1"
android:gravity="center_horizontal"
android:textSize="50sp"
/>
</TableRow> </TableLayout>
最新文章
- SQLSERVER 2012 收缩日志
- codeforces 507B. Painting Pebbles 解题报告
- Cannot attach the file as database &#39;membership&#39;.
- NeHe OpenGL教程 第二十二课:凹凸映射
- JavaScript 组件化开发之路(一)
- discuze回放提示“抱歉,您的请求来路不正确或表单验证串不符,无法提交”
- 免写前缀JS包--prefixfree.min.js--插件
- $digest already in progress
- FTP文件上传到HDFS上
- BZOJ_3670_[Noi2014]动物园_KMP
- java新特性
- 【转载】word2vec原理推导与代码分析
- WebApi 接口返回值不困惑:返回值类型详解。IHttpActionResult、void、HttpResponseMessage、自定义类型
- bzoj1651
- mysql之 误用SECONDS_BEHIND_MASTER衡量MYSQL主备的延迟时间
- oracle中insert 多条数据方法
- TP3.2批量上传文件(图片),解决同名冲突问题
- postgres模板数据库
- Django-rest-framework(七)swagger使用
- 详细步骤教你安装yii高级应用程序和配置composer环境