views:

238

answers:

1

Im trying to figure out how to line up items in each row of a table (TableLayout) - ideally I want the center of each cell to line up horizontally. The documentation isn't very clear on what's possible with TableLayout. Each cell has a different view widget so I thought a tabular layout would work well but they are all different sizes and default to top-left alignment inside each cell.

If I can't line them up then Ill need to use a different layout manager

+1  A: 

Set the layoutGravity of the view in the cell to be center-vertical, center-horizontal, center.

The layoutGravity tell the views parent how it wants to be displayed, so this will cause the table row to center it in the cell.

CaseyB