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

Source: Internet
Author: User

This example introduces the usage of android: stretchColumns. It specifies the serial numbers of columns that can be extended and separated by commas. Columns with the stretchable attribute can occupy redundant controls of the table (similar to weight in LinearLayout ).

<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_4_open"
Android: padding = "3dip"/>
<TextView
Android: text = "@ string/table_layout_4_open_shortcut"
Android: gravity = "right"
Android: padding = "3dip"/>
</TableRow>

<TableRow>
<TextView
Android: text = "@ string/table_layout_4_save"
Android: padding = "3dip"/>
<TextView
Android: text = "@ string/table_layout_4_save_shortcut"
Android: gravity = "right"
Android: padding = "3dip"/>
</TableRow>
</TableLayout>

In this example, the stretchable attribute is specified for Column 2nd, so the second column occupies the extra space of the table.

 

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.