Table中collapseColumns,stretchColumns
collapseColumns 设置需要被隐藏的列序号(序号从0开始)
shrinkColumns 设置允许被首夺的列的序号(序号从0开始)
stretchColumns 设置允许被拉伸的列的序号(序号从0开始)
原先没设置时候的样子
设置后的效果:
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/root_relativeLayout_id"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="第一个tabelLayout"
- android:textAppearance="?android:attr/textAppearanceLarge" />
- <!-- 第二列允许收缩,第三列允许拉伸 -->
- <TableLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- <strong><span style="color:#ff0000;">android:shrinkColumns="1" //收缩
- android:stretchColumns="2">//拉伸</span></strong>
- <Button
- android:id="@+id/button1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- <TableRow
- android:id="@+id/tableRow1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" >
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- <Button
- android:id="@+id/button3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="收缩的第二列,看出效果了么" />
- <Button
- android:id="@+id/button4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- </TableRow>
- </TableLayout>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="第二个tabelLayout"
- android:textAppearance="?android:attr/textAppearanceLarge" />
- <!-- 第二列隐藏 -->
- <TableLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- <strong><span style="color:#ff0000;">android:collapseColumns="1">//隐藏</span></strong>
- <Button
- android:id="@+id/button5"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- <TableRow
- android:id="@+id/tableRow2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" >
- <Button
- android:id="@+id/button6"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- <Button
- android:id="@+id/button7"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- <Button
- android:id="@+id/button8"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- </TableRow>
- </TableLayout>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="第三个tabelLayout"
- android:textAppearance="?android:attr/textAppearanceLarge" />
- <!-- 第二列和第三列拉伸 -->
- <TableLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- <strong><span style="color:#ff0000;"> android:stretchColumns="1,2">//拉伸</span></strong>
- <Button
- android:id="@+id/button9"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- <TableRow
- android:id="@+id/tableRow3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" >
- <Button
- android:id="@+id/button10"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- <Button
- android:id="@+id/button11"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- <Button
- android:id="@+id/button12"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- </TableRow>
- <TableRow
- android:id="@+id/tableRow4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" >
- <Button
- android:id="@+id/button13"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- <Button
- android:id="@+id/button14"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
- </TableRow>
- </TableLayout>
- </LinearLayout>
Table中collapseColumns,stretchColumns的更多相关文章
- TableLayout中collapseColumns,stretchColumns的介绍
设置后→ collapseColumns 设置需要被隐藏的列序号(序号从0开始) shrinkColumns 设置允许被首夺的列的序号(序号从0开始) stretchColumns ...
- bootstrap Table 中给某一特定值设置table选中
bootstrap Table 中给某一特定值设置table选中 需求: 如图所示:左边地图人员选定,右边表格相应选中. 功能代码: //表格和图标联动 function changeTableSel ...
- js遍历table中的每一个元素
function GetInfoFromTable(tableid) { var tableInfo = ""; var tableObj = document.getElemen ...
- IOS Table中Cell的重用reuse机制分析
IOS Table中Cell的重用reuse机制分析 技术交流新QQ群:414971585 创建UITableViewController子类的实例后,IDE生成的代码中有如下段落: - (UITab ...
- table中bordercolor属性设置后最新ie浏览器或firefox中不显示边线,借助table的css来实现边线
table中的bordercolor属性设置后在最新的ie或者firefox中均不显示边线,table的边线又是常用功能.只能使用css来实现了,更通用,更方便一些. css: .ctable{ b ...
- 如何让table中td宽度固定
table中td会随着里面的内容伸缩,设置其width样式并没有效果.这个时候需要下面的CSS可以实现. 首先是设置table .table {table-layout:fixed;} 其次是td . ...
- ajax将json写到table中去
查询条件: <table style="width: 100%;border-collapse: collapse;" > <tr> <th styl ...
- jquery 在 table 中修改某行值
修改 table 中某行的的方法步骤如下: 1.选择要修改的行,事件触发,比如我的 双击某行时修改 2.将要修改的行,替换为input,原先的列中的值,需要放到对应的input中作为默认值 3.修改完 ...
- 《项目经验》--后台一般处理程序向前台JS文件传递JSON,JS解析JSON,将数据显示在界面--显示在DropDownList 或 显示在动态创建的table中
http://blog.csdn.net/mazhaojuan/article/details/8599167 先看一下我要实现的功能界面: 这篇文章主要介绍:后台一般处理程序把从数据库查找的数据,转 ...
随机推荐
- 图学ES6-4.字符串的扩展
- Lambda表达式浅析
Lambda 表达式是一种可用于创建"委托"或"表达式目录树"类型的"匿名函数".通过使用 lambda 表达式,可以写入可作为参数传递或作 ...
- Vue2服务端渲染
Vue2 服务端渲染 花费了一个月时间,终于在新养车之家项目中成功部署了vue2服务端渲染(SSR),并且使用上了Vuex 负责状态管理,首屏加载时间从之前4G网络下的1000ms,提升到了现在500 ...
- chrome如何在选项卡打开网页
1.鼠标中间点击,会打开新选项卡 2.按住ctrl,然后鼠标点击,也是可以的 3.
- svn+apache
参考文章:http://www.ttlsa.com/svn/apache-svn-configure/ http://blog.csdn.net/huangshaotian/article/detai ...
- AngularJS之jeDate日期控件基本使用
业务背景: 初学AngularJs,最近一段时间,因业务需求,要求日期选择带有快捷键.时分秒等.鉴于AngularJS组件库ui-bootstrap没有此功能,找了一款基于原生JS实现的插件-jeDa ...
- HttpServlet Service方法
service() 方法是执行实际任务的主要方法.Servlet 容器(即 Web 服务器)调用 service() 方法来处理来自客户端(浏览器)的请求,并把格式化的响应写回给客户端. 每次服务器接 ...
- FireDAC 下的 Sqlite [8] - 自定义函数
Sqlite 本身没有这个功能, FireDAC 通过 TFDSQLiteFunction 增加了该功能; 尽管通过某些 SQL 语句或通过视图也可以达到类似效果, 但函数会更灵活些. 本例先建了一个 ...
- spring cloud 学习(8) - sleuth & zipkin 调用链跟踪
业务复杂的微服务架构中,往往服务之间的调用关系比较难梳理,一次http请求中,可能涉及到多个服务的调用(eg: service A -> service B -> service C... ...
- HDU 4031 Attack
Attack Time Limit: 5000/3000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Total Sub ...