0
votes

I'm relatively new to Android and what I want to achieve is a table/grid type layout with multiple rows. Column 2 onwards should always be aligned horizontally or for rows with less columns for them to stretch to the width of the container. i.e. in the example below the textbox on line 1 stretches across to fill column 2 and 3 (e.g. on my android phone the width of the screen)

-------------------------------------
|label        | textbox............ |
|longer label | textbox..  | button |
|-----------------------------------|

Kind of thing. I tried with a table, which works, but I cannot span columns. All I could find was android:layout_span on some website but that doesn't seem to be available (well, to Eclipse anyway).

Maybe table isn't the right layout, but that's all I could find to allow me to align columns. I'd prefer to have it all in the layout XML rather than coding it.

1

1 Answers

0
votes

Did you try having a few horizontal linear layout within one vertical linear layout ? It might make your XML file a little bit longer, but it may also solve the issue.

Rule of thumb: Don't trust Eclipse's interpretation of the interface. It's not always right.