My layout looks like:
<TableLayout>
<TableRow></TableRow>
<TableLayout>
<TableRow></TableRow>
<TableRow></TableRow>
<TableRow></TableRow>
</TableLayout>
</TableLayout>
I have a TableLayout within a TableLayout. When it first loads, the inner TableLayout visibility is set to Gone. So it's just a single TableRow. When the user clicks on the single TableRow, it changes visibility of the inner TableLayout to Visible.
Problem is, the columns in the first TableRow do not line up with the other TableRows. How might I go about getting them to all line up?
I'm using another TableLayout inside so that I can sim开发者_如何学运维ply setVisibility on that single TableLayout instead of having to do it on all the rows and spacers. Maybe there is a better way?
It seems like you may be trying to use <TableLayout />
beyond what it's generally recommended for. If you're not laying out tabular data (like a spreadsheet), I highly recommend trying to re-think your layout in terms of a <RelativeLayout />
. RelativeLayouts will help you cut down on the number of Views in your layout, which will increase performance. Defining all your views in their relation to one another (using the RelativeLayout) will also help your layout scale to different sized screens.
精彩评论