2013-04-30 83 views
0

是否可以並排顯示兩個TableLayout(在RelativeLayout中),以便兩個表具有相同的寬度?我只是不知道該怎麼做。我已經試過將android:stretchColumns="*"設置爲兩個表格,但它只是將一個表格拉伸至100%寬度,而第二個表格則被拉出屏幕。並排顯示兩個TableLayouts

回答

3

你也許可以做到這一點與一個LinearLayout並設置每個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>