属性介绍

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>

Android 表格布局 TableLayout的更多相关文章

  1. Android 表格布局<TableLayout>

    表格布局即,tableLayout,表格布局通过行.列的形式来管理UI组件,TablelLayout并不需要明确地声明包含多少行.多少列,而是通过TableRow,以及其他组件来控制表格的行数和列数, ...

  2. .Net程序猿玩转Android开发---(8)表格布局TableLayout

    表格布局TableLayout是Android中比較经常使用的一个布局控件,既然是表格,肯定有行和列,TableLayout中的行有TableRow组成.列依据每行控件的数量来确定 假如第一行有3个控 ...

  3. Android 自学之表格布局 TableLayout

    表格布局(TableLayout),表格布局采用行.列的形式来管理UI组件,TableLayout并不需要明确的声明多少行,多少列,而是通过TableRow.其他组件来控制表格的行数和列数. 每次想T ...

  4. Android表格布局(Table Layout)

    Android表格布局(Table Layout) 先来看布局管理器之间继承关系图: 图1 可知TableLayout继承了LinearLayout,所以表格布局本质上依然是线性管理器. 表格布局采用 ...

  5. Android表格布局之设置边框

    Android表格布局本身没有边框,不过可以通过背景色的设置可以实现表格边框的显示. 首先可以设置TableRow的背景色,然后设置内容的背景色.根据它们的颜色差就出现了边框.只要微调Content与 ...

  6. Android课程---表格布局TableLayout

    特别注意:由于表格布局继承自线性布局,因此并不显示表格线 示例代码: <?xml version="1.0" encoding="utf-8"?> ...

  7. Android布局_表格布局TableLayout

    一.TableLayout概述 TableLayout表格布局模型以行列的形式管理子控件,每一行为一个TableRow的对象,当然也可以是一个View的对象 二.TableLayout的全局属性  1 ...

  8. Android开发5:布局管理器2(表格布局TableLayout)

    版本:Android4.3 API18  学习整理:liuxinming 概念      TableLayout继承了LinearLayout,因此它的本质依然是线性布局管理器.      表格布局采 ...

  9. Android中的表格布局TableLayout

    表格布局最基本的三个属性: XML代码实例: <?xml version="1.0" encoding="utf-8"?> <LinearLa ...

随机推荐

  1. webpack到底是干什么用的?

    转载于:https://segmentfault.com/a/1190000014148611?utm_source=tag-newest 概念问题一:什么是webpack和grunt和gulp有什么 ...

  2. 最全最新🇨🇳中国【省、市、区县、乡镇街道】json,csv,sql数据

    中华人民共和国行政区划代码 中华人民共和国行政区划(五级):省级.地级.县级.乡级和村级. 来自中华人民共和国民政部,用于查询中国省,市和区数据的网站. 中华人民共和国行政区划代码,更新时间:2019 ...

  3. C数据结构(文件操作,随机数,排序,栈和队列,图和遍历,最小生成树,最短路径)程序例子

    文件操作 文件打开方式               意义     ”r” 只读打开一个文本文件,只允许读数据     ”w” 只写打开或建立一个文本文件,只允许写数据     ”a” 追加打开一个文本 ...

  4. windows下PyCharm安装及使用 【转自 https://blog.csdn.net/yctjin/article/details/70307933?locationNum=11&fps=1】

    一.首先安装pycharm,可以参考这篇文章:http://www.jianshu.com/p/042324342bf4 搭建环境 1.win10_X64,其他Win版本也可以.2.PyCharm版本 ...

  5. WSGI到底是什么?

    在用Python Web开发时经常会遇到WSGI,所以WSGI到底是什么呢?本文我们一起来揭开WSGI神秘的面纱! 先来看一下WSGI的介绍: 全称Python Web Server Gateway ...

  6. 用launchscreen.storyboard适配启动图方法(二)

    背景 之前有写一篇实现方式比较简单的随笔用launchscreen.storyboard适配启动图方法,顺便在评论区提了一下用autolayout适配启动图的思路,现把思路和流程记录下来. 思路 整体 ...

  7. 《手把手教你》系列练习篇之9-python+ selenium自动化测试 -番外篇 - 最后一波啊!!!(详细教程)

    1. 简介 本来上一篇就是练习篇的最后一篇文章了,但是有的小伙伴私下反映说是做了那么多练习,没有一个比较综合的demo练练手.因此宏哥在这里又补存了一些常见的知识点进行练习,在文章最后也通过实例给小伙 ...

  8. 链接脚本(Linker Script)用法解析(二) clear_table & copy_table

    可执行文件中的.bss段和.data段分别存放未赋初值的全局变量和已赋初值的全局变量,两者的特点分别为: (1).bss段:①无初值,所以不占ROM空间:②运行时存储于RAM:③默认初值为0 (2). ...

  9. 深度研究:回归模型评价指标R2_score

    回归模型的性能的评价指标主要有:RMSE(平方根误差).MAE(平均绝对误差).MSE(平均平方误差).R2_score.但是当量纲不同时,RMSE.MAE.MSE难以衡量模型效果好坏.这就需要用到R ...

  10. 接口访问报错:The valid characters are defined in RFC 7230 and RFC 3986

    写了个接口,在测试访问的时候,需要传json串,但是后台报错了 The valid characters are defined in RFC 7230 and RFC 3986 当前使用的tomca ...