Question

TableLayout contains the handy attribute android:stretchColumns="*" to distribute column width evenly over the size of the table. Can the same be done for rows?

Was it helpful?

Solution

TableLayout extends LinearLayout, so you can just define your TableRows as such:

<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="0"
     android:layout_weight="1"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top