TableLayout实现均匀布局(条目横向1:1排列)
来源:互联网 发布:win7 激活软件 编辑:程序博客网 时间:2024/06/07 00:59
像下面的布局效果,我们经常使用LinearLayout实现,其实也可以使用TableLayout去简单的实现
代码如下:
<TableLayout android:layout_width="match_parent" android:layout_height="match_parent" android:padding="@dimen/spacing_small" android:stretchColumns="*"> <TableRow> <TextView style="@style/GrayText" android:layout_width="1dp" android:text="订单号" /> <TextView style="@style/GrayText" android:layout_width="1dp" android:text="预定时间" /> </TableRow> <TableRow android:layout_marginTop="@dimen/spacing_tiny"> <TextView android:id="@+id/order_num" style="@style/BlackText" android:layout_width="1dp" android:text="201687" /> <TextView android:id="@+id/time" style="@style/BlackText" android:layout_width="1dp" android:text="2016年3月24日" /> </TableRow> <TableRow android:layout_marginTop="@dimen/spacing_normal"> <TextView style="@style/GrayText" android:layout_width="1dp" android:text="出行目的" /> <TextView style="@style/GrayText" android:layout_width="1dp" android:text="订单状态" /> </TableRow> <TableRow android:layout_marginTop="@dimen/spacing_tiny"> <TextView android:id="@+id/aim" style="@style/BlackText" android:layout_width="1dp" android:text="商务谈判" /> <TextView android:id="@+id/order_status" style="@style/BlueText" android:layout_width="1dp" android:text="出票中" /> </TableRow> </TableLayout>
这里有几个属性需要设置:
android:stretchColumns=”*”
TableRow里面的子view宽度统一设置成一个固定值如1dp
0 0
- TableLayout实现均匀布局(条目横向1:1排列)
- li标签,实现横向排列
- Xlistview实现多条目布局
- 自定义ViewGroup(1)--横向布局
- Android布局 实现圆角边框 tablelayout
- android开发利用tablelayout布局实现登录界面
- Android开发总结笔记 TableLayout(表格布局) 1-1-4
- TableLayout布局
- TableLayout布局
- TableLayout布局
- 如何在TableLayout中均匀拉伸columns?
- CSS实现简单的横向排列demo
- WPF实现listview横向排列图标
- 实现横向排列的几种方案
- recycleview实现title横向滑动,点击条目居中显示
- 九宫格均匀布局
- 产生均匀随机排列数组
- RecyclerView实现复杂首页(条目)布局
- linux 下 opencv配置
- bootstrap学习笔记
- Cocoapods的安装及使用(整理)
- LeetCode 309. Best Time to Buy and Sell Stock with Cooldown
- 《深度探索C++对象模型》笔记(一)
- TableLayout实现均匀布局(条目横向1:1排列)
- 谈谈Navicat for Oracle 表栏位的使用
- Java的接口和抽象类
- HDFS 原理、架构、应用
- 转岗-android
- Java泛型中? super T和? extends T的区别
- sql server生成脚本
- vagrant up errors
- NYOJ484 The Famous Clock