Non Row Children of Table Layout

Normally, TableLayout contains only TableRow elements as immediate children. However, it is possible to put other widgets in between rows. For those widgets, TableLayout behaves a bit like LinearLayout with vertical orientation. The widgets automatically have their width set to fill parent, so they will fill the same space that the longest row does.

One pattern for this is to use a plain View as a divider (e.g., <View android:layout height = "2px" android:background = "#0000FF" /> as a two-pixel-high blue bar across the width of the table).

0 0

Post a comment