Android's understanding of table layout

Source: Internet
Author: User

Table Layout (tablelayout)

The knowledge points used are:

Control

TableRow: Add a row for this table

Special Properties of Table

Android:layout_column: Determine the number of columns for this table

Android:stretchcolumns: Determining the extruded columns

Android:shrinkcolumns: Confirming the compressed column

Properties that can be added to a control in a table

Android:layour_column: Specifies the specific location of this control

<Tablelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Fill_parent"Android:layout_height= "Fill_parent"Android:stretchcolumns= "2">    <TableRowAndroid:id= "@+id/tablerow1"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content" >        <ButtonAndroid:id= "@+id/button1"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "button" />        <ButtonAndroid:id= "@+id/button2"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "button" />    </TableRow>    <TableRowAndroid:id= "@+id/tablerow2"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent">        <ButtonAndroid:id= "@+id/button3"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_column= "1"Android:text= "button" />        <ButtonAndroid:id= "@+id/button4"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_column= "2"Android:text= "button" />    </TableRow>    <TableRowAndroid:id= "@+id/tablerow3"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content" >        <ButtonAndroid:id= "@+id/button5"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_column= "2"Android:text= "button" />    </TableRow></Tablelayout>

The code for the above layout

Android's understanding of table layout

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.