TableLayout 佈局介紹
来源:互联网 发布:节流装置计算软件 编辑:程序博客网 时间:2024/06/06 09:39
TableLayout 允許我們使用表格的方式來排列控件,
以下為一個簡單的登錄界面,
通過TableRow 定義行,每加入一個TableRow即新增一行,在TableRow中每新增一個控件,即新增一列。
通過android:stretchColumns 設定第N+1行進行拉伸,以達到自動適應屏幕的作用。
通過android:inputType 指定密碼文本框為password。
通過android:layout_span 指定login按鈕佔據兩列。
<?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_height="wrap_content" android:text="Accout:"/> <EditText android:id="@+id/accout" android:layout_height="wrap_content" android:hint="input your accout"/> </TableRow> <TableRow > <TextView android:layout_height="wrap_content" android:text="Password"/> <EditText android:id="@+id/password" android:layout_height="wrap_content" android:inputType="textPassword"/> </TableRow> <TableRow > <Button android:layout_height="wrap_content" android:id="@+id/login" android:layout_span = '2' android:text="Login"/> </TableRow> <TableRow > <Button android:layout_height="wrap_content" android:id="@+id/exit" android:layout_span = '2' android:text="exit"/> </TableRow></TableLayout>
0 0
- TableLayout 佈局介紹
- tablelayout
- TableLayout
- tablelayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- TableLayout
- Tablelayout
- Tablelayout
- HDU1166 敌兵布阵 【单节点经典题】
- Java虚拟机结构分析
- 【活动】DevOps直播技术架构养成记
- 故障案例--mongo shell从库无法读的处理方法
- 编译Linux内核
- TableLayout 佈局介紹
- 文章标题
- iOS开发-UIWebView加载本地和网络数据
- hdu1028 Ignatius and the Princess III 递推
- 104 Maximum Depth of Binary Tree
- ios图片添加水印
- N通道Float 差值算法
- OCP(02).安装Oracle11g
- av格式