TableLayout中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>
TableLayout中collapseColumns,stretchColumns的介绍的更多相关文章
- Table中collapseColumns,stretchColumns
collapseColumns 设置需要被隐藏的列序号(序号从0开始) shrinkColumns 设置允许被首夺的列的序号(序号从0开始) stretchColumns 设置允许被拉 ...
- asp.net中缓存的使用介绍一
asp.net中缓存的使用介绍一 介绍: 在我解释cache管理机制时,首先让我阐明下一个观念:IE下面的数据管理.每个人都会用不同的方法去解决如何在IE在管理数据.有的会提到用状态管理,有的提到的c ...
- lua解析脚本过程中的关键数据结构介绍
在这一篇文章中我先来介绍一下lua解析一个脚本文件时要用到的一些关键的数据结构,为将来的一系列代码分析打下一个良好的基础.在整个过程中,比较重要的几个源码文件分别是:llex.h,lparse.h.l ...
- linux中ldconfig的使用介绍
linux中ldconfig的使用介绍 ldconfig是一个动态链接库管理命令,其目的为了让动态链接库为系统所共享. ldconfig的主要用途: 默认搜寻/lilb和/usr/lib,以及配置文件 ...
- 【js】IE、FF、Chrome浏览器中的JS差异介绍
如何判断浏览器类型 转:http://www.cnblogs.com/carekee/articles/1854674.html 1.通过浏览器特有的对象 如ie 的ActiveXObject ff ...
- Apache中 RewriteRule 规则参数介绍
Apache中 RewriteRule 规则参数介绍 摘要: Apache模块 mod_rewrite 提供了一个基于正则表达式分析器的重写引擎来实时重写URL请求.它支持每个完整规则可以拥有不限数量 ...
- 使用Memcache在PHP中调试方法的介绍及应用
使用Memcache在PHP中调试方法的介绍及应用 如果我们在网络开发中,特别是大访问量的web项目开发中,为了提高响应速度,减少数据查询运算,那么我们都会选用memcahce.首先我们必须要安装,接 ...
- python中multiprocessing.pool函数介绍_正在拉磨_新浪博客
python中multiprocessing.pool函数介绍_正在拉磨_新浪博客 python中multiprocessing.pool函数介绍 (2010-06-10 03:46:5 ...
- 基于Server-Sent Event的简单聊天室 Web 2.0时代,即时通信已经成为必不可少的网站功能,那实现Web即时通信的机制有哪些呢?在这门项目课中我们将一一介绍。最后我们将会实现一个基于Server-Sent Event和Flask简单的在线聊天室。
基于Server-Sent Event的简单聊天室 Web 2.0时代,即时通信已经成为必不可少的网站功能,那实现Web即时通信的机制有哪些呢?在这门项目课中我们将一一介绍.最后我们将会实现一个基于S ...
随机推荐
- salesforce
salesforce&apex salesforce开发的小心得 salesforce零基础学习(七十七)队列的实现以及应用 摘要: 队列和栈简单的区别为栈是后进先出,队列是先进先出.队列也是 ...
- UVALive - 6709
二维线段树单点修改板子题 #include<bits/stdc++.h> #define LL long long #define fi first #define se second # ...
- spark streaming的容错:防止数据丢失
官方这么说的 [Since Spark 1.2] Configuring write ahead logs - Since Spark 1.2, we have introduced write ah ...
- 利用 gdb 探究main(int argc, char *argv[]){} 中的char *argv[]
在 Linux 系统中编写小程序 代码如下 编译并采用gdb调试 在调试之前设置三个参数 a bb ccc 输入 start 执行代码到 return 0; 从这里可以看到 argc = ...
- JAVA 图形开发中组件对齐方法及界面开发
/*文章中用到的代码只是一部分,需要源码的可通过邮箱联系我 1978702969@qq.com*/ 在上篇博客中提到了JAVA图形界面开发时的两种布局,流式布局和边框布局. 在实际使用中可能会发现,往 ...
- JedisConnectionException: java.net.ConnectException: Connection refused
出现问题 我遇到的一个问题,在连接redis的时候出现了错误!错误如下: JedisConnectionException: java.net.ConnectException: Connection ...
- odoo视图继承
odoo视图继承 简介继承 在odoo里可以通过继承的方式来改写已经存在的view 对比view的定义视图定义中写法多了inherit_id inherit_id指向要改写的view <fiel ...
- [代码审计]云优cms V 1.1.2前台多处sql注入,任意文件删除修复绕过至getshell
0X00 总体简介 云优CMS于2017年9月上线全新版本,二级域名分站,内容分站独立,七牛云存储,自定义字段,自定义表单,自定义栏目权限,自定义管理权限等众多功能深受用户青睐,上线短短3个月,下载次 ...
- zookeeper 节点启动时的更新机制
使用zk的应用节点和zk数据本身的同步,当系统启动时使用zk配置的信息和zk本身存储不一致, 此时应存在一个更新机制将应用配置数据和zk数据更新一致. 启动时更新拉取zk配置中心的更新本地数据,以zk ...
- android 的安全问题
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha 1,webView的js脚本引发的安全 2,代码的混淆加密.还可采用第三方apk加固程序 ...