TableLayout
来源:互联网 发布:淘宝怎样套现信用卡 编辑:程序博客网 时间:2024/06/13 00:05
继承自LinearLayout
不用明确声明行,列
通过添加TableRow来添加行
TableRow也是组件,向其中添加自组件构成列
若直接向TableLayout中添加组件,则此组件直接为一行
特有的xml属性
android:collapseColumns 要被隐藏的列的序号
android:shrinkColumns 允许被收缩的列(适应父布局)
android:stretchColumns 允许被拉伸的列(保证填满剩余空间)
tip:
推荐将字符串集中放到xml文件中管理,包括按钮上显式的文本之类的
布局文件
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" > <!--第一个表格布局,第二列允许收缩,第三列允许拉伸--> <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:shrinkColumns="1" android:stretchColumns="3" android:collapseColumns="2"> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="占一行的按钮"/> <TableRow> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1普通按钮"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2收缩按钮"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3隐藏按钮"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="4拉伸按钮"/> </TableRow>`` </TableLayout></LinearLayout>
阅读全文
0 0
- tablelayout
- TableLayout
- tablelayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- Tablelayout
- Tablelayout
- TableLayout
- 索引深入理解索引提高查询速度的原因
- 小谈CSRF
- Python3zip压缩解压简单使用
- C语言中time函数和localtime获取系统时间和日期
- PAT甲级 1044
- TableLayout
- HTTPS静态服务搭建过程详解
- Ubuntu 安装 JDK 7 / JDK8 的两种方式 ubuntu 安装jdk 的两种方式
- 苹果公司透露Siri新发音引擎的内部原理
- Mysql数据库索引
- github设置添加SSH
- LeetCode:在线编程刷题网站
- java-单例模式
- Android WebView设置cookie