tags:

views:

511

answers:

3

I'm using a TableLayout in Android. Right now I have one TableRow with two items in it, and, below that, a TableRow with one item it it. It renders like this:

-----------------------------
|   Cell 1    |  Cell 2     |
-----------------------------
|   Cell 3    |
---------------

What I want to do is make Cell 3 stretch across both upper cells, so it looks like this:

-----------------------------
|   Cell 1    |  Cell 2     |
-----------------------------
|           Cell 3          |
-----------------------------

In HTML I'd use a COLSPAN.... how do I make this work in Android?

+1  A: 

I think you need to wrap a layout around another one. Have one Layout list vertically, inside have another one (or in this case, two) list horizontally.

I'm still finding it hard to nicely split interface to 50-50 portion in Android.

RobGThai
I ended up doing this to get around a different table-related bug that was causing 1/3 of my layout to be hidden in landscape mode, for unknown reasons.
Spike Williams
+6  A: 

It seems that there is an attribute doing that : layout_span

Sephy
Yup, this is the one. The Eclipse layout widget doesn't seem to know about it, however, as it was not listed among the available properties. But it does work.
Spike Williams
A: 

Im weired with the example code of Android. Its not at all easy.

Santhosh