Android ApiDemos example resolution (165): Views-& gt; Layouts-& gt; Tabl

Source: Internet
Author: User

In this example, LabelLayout is used to construct a simple input form:

<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" indicates that the second column occupies the remaining space of the table. Note that the android: scrollHorizontally attribute of EditText changes the height of the row when multiple rows are entered in EditText:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.