Buttons to fill width when using TableLayout

Pentium10 picture Pentium10 · Feb 10, 2010 · Viewed 21.9k times · Source

I have a table having 2 rows each row having 3 buttons. How can I make the buttons to fill the space equally. In HTML I would give them 33% width.

Also do you know any way I can create a view having 4 image buttons in a row as a grid layout, similar to the launcher.

Answer

Mark B picture Mark B · Feb 10, 2010

Try adding android:stretchColumns="*" to your <TableLayout> tag.