表格布局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>

最新文章

  1. SQLSERVER 2012 收缩日志
  2. codeforces 507B. Painting Pebbles 解题报告
  3. Cannot attach the file as database &#39;membership&#39;.
  4. NeHe OpenGL教程 第二十二课:凹凸映射
  5. JavaScript 组件化开发之路(一)
  6. discuze回放提示“抱歉,您的请求来路不正确或表单验证串不符,无法提交”
  7. 免写前缀JS包--prefixfree.min.js--插件
  8. $digest already in progress
  9. FTP文件上传到HDFS上
  10. BZOJ_3670_[Noi2014]动物园_KMP
  11. java新特性
  12. 【转载】word2vec原理推导与代码分析
  13. WebApi 接口返回值不困惑:返回值类型详解。IHttpActionResult、void、HttpResponseMessage、自定义类型
  14. bzoj1651
  15. mysql之 误用SECONDS_BEHIND_MASTER衡量MYSQL主备的延迟时间
  16. oracle中insert 多条数据方法
  17. TP3.2批量上传文件(图片),解决同名冲突问题
  18. postgres模板数据库
  19. Django-rest-framework(七)swagger使用
  20. 详细步骤教你安装yii高级应用程序和配置composer环境

热门文章

  1. linux库冲突解决方法 apt purge / aptitude purge
  2. python基于yield实现协程
  3. s5_day8作业
  4. CodeForces - 451E Devu and Flowers (容斥+卢卡斯)
  5. Linux下代理服务器(proxy)配置
  6. linux命令(6/8):crontab命令
  7. Mysql字段属性应该尽量设置为not null
  8. Nginx 自定义404、500错误页面跳转
  9. 外部类与main方法笔记
  10. 部署私有云网盘owncloud