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