2014-11-05 30 views

回答

0

您可以使用TableLayout來執行此操作。只需添加按鈕TableRow S和給他們match_parent寬度

0

的一種方式是一個表:

<TableLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <TableRow> 
     <Button /> 
     <Button /> 
    </TableRow> 
<\TableLayout> 

替代地,可以執行水平線性佈局和分配權重給每個按鈕爲0的寬度。

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" > 
    <Button 
     android:layout_width="0dp" 
     android:layout_weight="1" /> 
    <Button 
     android:layout_width="0dp" 
     android:layout_weight="1" /> 
<\LinearLayout> 
相關問題