Tablelayout Inheritance LinearLayout
How many rows are there in a TableRow object?
Number of columns equal to TableRow of most child controls
Directly in the Tablelayout control, the control will occupy a row
Tablelayout Properties:
Android:shrinkcolumns-------Set the columns that can be shrunk (the content is too much, then shrinks, expands to the second row, the control does not work when the tablelayout is not covered)
Android:stretchcolumns------Set extendable columns (filled with blanks)
Columns can have both Stretchcolumns and Shrinkcolumns properties
Android:collapsecolumns------Setting the columns to hide
Cell Properties:
Android:layout_column-------The cell is displayed in the first few columns
Android:layout_span-------The cell occupies a number of columns, the default is 1
Stretch Shrink instance:
<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical" > <!--Table 1-Stretching - <TablelayoutAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:background= "#ff0000"Android:shrinkcolumns= "0,1,2" > <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "I occupy one line" /> <TableRow> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "000000000000000000000000" > </Button> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "111111111111111111111111" > </Button> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "222222222222222222222222" > </Button> </TableRow> <TableRow> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "000000000000000000000000" > </Button> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_span= "2"Android:text= "I occupy 2 columns" > </Button> </TableRow> </Tablelayout> <!--Table 2-Shrinkage - <TablelayoutAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"Android:background= "#FFCD6B"Android:stretchcolumns= "0,1" > <TableRow> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Fill One" /> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Fill Two" /> <ButtonAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Normal three" /> </TableRow> </Tablelayout></LinearLayout>