Android ApiDemos示例解析(165):Views->Layouts->TableLayout->10. Simple Form
来源:互联网 发布:成都编程招聘 编辑:程序博客网 时间:2024/06/03 17:18
前面介绍了使用LinerLayout和RelativeLayout构造Simple Form:
Android ApiDemos示例解析(145):Views->Layouts->LinearLayout->5.Simple Form
Android ApiDemos示例解析(152):Views->Layouts->RelativeLayout->2.Simple Form
本例使用LabelLayout构造了一个简单输入表单:
<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:text=”@string/table_layout_10_user”
android:textStyle=”bold”
android:gravity=”right”
android:padding=”3dip” />
<EditText android:id=”@+id/username”
android:text=”@string/table_layout_10_username_text”
android:padding=”3dip”
android:scrollHorizontally=”true” />
</TableRow>
<TableRow>
<TextView
android:text=”@string/table_layout_10_password”
android:textStyle=”bold”
android:gravity=”right”
android:padding=”3dip” />
<EditText android:id=”@+id/password”
android:text=”@string/table_layout_10_password_text”
android:password=”true”
android:padding=”3dip”
android:scrollHorizontally=”true” />
</TableRow>
<TableRow
android:gravity=”right”>
<Button android:id=”@+id/cancel”
android:text=”@string/table_layout_10_cancel” />
<Button android:id=”@+id/login”
android:text=”@string/table_layout_10_login” />
</TableRow>
</TableLayout>
android:stretchColumns=”1″ 表示第二列将占据表格剩余空间,注意EditText 的android:scrollHorizontally 属性,当EditText输入多行时,该行高度也会跟着变化:
- Android ApiDemos示例解析(165):Views->Layouts->TableLayout->10. Simple Form
- Android ApiDemos示例解析(156):Views->Layouts->TableLayout->01. Basic
- Android ApiDemos示例解析(159):Views->Layouts->TableLayout->04.Stretchable
- Android ApiDemos示例解析(166):Views->Layouts->TableLayout->11. Gravity
- Android ApiDemos示例解析(145):Views->Layouts->LinearLayout->5.Simple Form
- Android ApiDemos示例解析(152):Views->Layouts->RelativeLayout->2.Simple Form
- Android ApiDemos示例解析(157):Views->Layouts->TableLayout->02. Empty Cells
- Android ApiDemos示例解析(158):Views->Layouts->TableLayout->03.Long Content
- Android ApiDemos示例解析(160):Views->Layouts->TableLayout->05. Spanning and Stretchable
- Android ApiDemos示例解析(161):Views->Layouts->TableLayout->06. More Spanning and Stretchable
- Android ApiDemos示例解析(162):Views->Layouts->TableLayout->07. Column Collapse
- Android ApiDemos示例解析(163):Views->Layouts->TableLayout->08. Toggle Stretch
- Android ApiDemos示例解析(164):Views->Layouts->TableLayout->09. Toggle Shrink
- Android ApiDemos示例解析(167):Views->Layouts->TableLayout->12. Cell Spanning
- Android ApiDemos示例解析(133):Views->Layouts->Baseline->1.Top
- Android ApiDemos示例解析(134):Views->Layouts->Baseline->2. Bottom
- Android ApiDemos示例解析(135):Views->Layouts->Baseline->3. Center
- Android ApiDemos示例解析(136):Views->Layouts->Baseline->4. Everywhere
- C程序内存区域分配(5个段作用)
- Android ApiDemos示例解析(164):Views->Layouts->TableLayout->09. Toggle Shrink
- CreateDevice()
- 想你,但不爱你
- 排序算法 C++
- Android ApiDemos示例解析(165):Views->Layouts->TableLayout->10. Simple Form
- [转] 101个Google搜索技巧,你都会哪几个?
- Android ApiDemos示例解析(166):Views->Layouts->TableLayout->11. Gravity
- BeginScene() And EndScene()
- Android ApiDemos示例解析(167):Views->Layouts->TableLayout->12. Cell Spanning
- 你若安好
- 【知识储备】 jquery 小总结
- 机器学习中的数学(5)-强大的矩阵奇异值分解(SVD)及其应用
- iPhone开发--AVAudionPlayer支持后台播放