February 25, 2010

[SOLVED]Android: Column span in TableLayout


<!-- snipped -->
<TableLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="*">
<TableRow>
<TextView android:id="@+id/info"
android:layout_span="3"
android:text="@string/info"
android:layout_gravity="center_horizontal" />
</TableRow>
<TableRow>
<Button android:id="@+id/button_add" android:text="+" />
<TextView android:text="@string/label" />
<TextView android:id="@+id/amount" />
</TableRow>
<!-- snipped -->
</TableLayout>
<!-- snipped -->


TableLayout supports column span on Android Development.

4 comments:

  1. it likes html, but not intuitive

    ReplyDelete
  2. How to this (android:layout_span="3") through code...
    I am unable to get syntax to set the span dynamically through code.

    ReplyDelete
  3. Hello,

    How about setting the column span of a single cell in the . java and not here in .xml? Do you know how?

    You're help is really much appreciated. Thank you very much.

    ReplyDelete
  4. how to do this programatically???

    ReplyDelete