表格布局(TableLayout)

使用的知识点有:

控件

TableRow:为这个表格添加一行

table的特殊属性

android:layout_column:确定此表格的列数

android:stretchColumns:确定拉伸的列

android:shrinkColumns:确认压缩的列

table中控件可添加的属性

android:layour_column:指定此控件具体的位置

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="2">
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="Button" />
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="Button" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="Button" />
</TableRow>
</TableLayout>

上述布局的代码

最新文章

  1. ECharts 初识(基于MVC+jQuery+Angularjs实现的Demo)
  2. python学习道路(day5note)(列表生成式,生成器,装饰器,常用模块)
  3. Scalaz(38)- Free :Coproduct-Monadic语句组合
  4. 【C++专题】static_cast, dynamic_cast, const_cast探讨
  5. 修改eclipse默认编码方式
  6. 如何在Ubuntu 12.04 Server 中安装图形用户界面
  7. uiautomator &lt;一&gt; 编译运行
  8. Max Sum (hdu 1003 简单DP水过)
  9. URL加载页面的过程
  10. [LeetCode] Number Complement 补数
  11. qt4 看不到qstring内容
  12. 7、Python-引用传递与值传递
  13. centos中文语言安装
  14. ASP.NET Web API 中使用 swagger 来管理 API 文档
  15. mysqldump参数详细说明
  16. CSS拾遗
  17. 用R进行统计学分析
  18. Android 布局详解 -三表格布局(TableLayout)以及重要属性
  19. css的四种书写方式
  20. 3星|《十大全球CEO亲授企业高速成长的关键战略》:作为CEO,我也非常坦率地表明过家庭优先于工作

热门文章

  1. JavaScript 语法
  2. 关于a.b和a[b]的区别
  3. 蓝桥网试题 java 入门训练 Fibonacci数列
  4. C++编程练习(12)----“有向图的拓扑排序“
  5. db2_errroecode
  6. 基于python的互联网软件测试开发(自动化测试)-全集合
  7. chrome浏览器360浏览器图片无法加载提示等待可用套接字问题
  8. link js重构心得
  9. 跟着内核学框架-从misc子系统到3+2+1设备识别驱动框架
  10. React 笔记