What is the equivalent of "colspan" in an Android TableLayout? Ask Question

What is the equivalent of

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

It seems that there is an attribute doing that : layout_span

UPDATE: This attribute must be applied to the children of the TableRow. NOT to the TableRow itself.

おすすめ記事