首页 > 学院 > 开发设计 > 正文

安卓布局 - 表格布局(TableLayout)

2019-11-09 16:38:18
字体:
来源:转载
供稿:网友

这里写图片描述

<?xml version="1.0" encoding="utf-8"?><TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns="1" > <TableRow> <TextView android:layout_column="1" android:text="Open"/> <TextView android:gravity="right" android:text="Ctrl+O"/> </TableRow> <TableRow> <TextView android:layout_column="1" android:layout_span="2" android:text="占用2列"/> </TableRow> <TextView android:layout_height="1dp" android:background="#666666"/> <TableRow> <TextView android:layout_column="1" android:text="Save"/> <TextView android:gravity="right" android:text="Ctrl+S"/> </TableRow> <TableRow> <TextView android:text="X"/> <TextView android:text="Import"/> <TextView android:gravity="right" android:text="Ctrl+I"/> </TableRow></TableLayout>

这里写图片描述

android:stretchColumns="1"拉伸第1列填充整个屏幕宽度 android:layout_column="1"指定该控制为第1列


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表