1

Is it possible to display two TableLayouts (in a RelativeLayout) side by side so that both tables have the same width? I just don't know how to do that. I already tried it with setting android:stretchColumns="*" to both tables, but it's just stretching one table to 100% width and the second table gets pushed out of the screen.

4

1 回答 1

4

您可能可以使用 aLinearLayout并将每个TableLayout权重设置为 0.5

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
    <TableLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="0.5" />
    <TableLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="0.5" />
</LinearLayout>
于 2013-04-30T01:35:23.263 回答