2011-09-11 5 views

답변

2

한 가지 방법은 android:layout_weight="1"과 더불어, LinearLayout 사용하는 것입니다 :

<LinearLayout 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:orientation="horizontal"> 
    <Button 
     android:text="Button 1" 
     android:layout_height="wrap_content" 
     android:layout_width="0dp" 
     android:layout_weight="1" /> 
    <Button 
     android:text="Button 2" 
     android:layout_height="wrap_content" 
     android:layout_width="0dp" 
     android:layout_weight="1" /> 
    <Button 
     android:text="Button 3" 
     android:layout_height="wrap_content" 
     android:layout_width="0dp" 
     android:layout_weight="1" /> 
</LinearLayout> 
1

TableLayout : 3 열 2 행, stretchModespacingWidthUniform을 사용할 수 있어야합니다.

편집 : 시도하지 않았으므로 정상적으로 작동합니다.

<TableLayout android:id="@+id/TableLayout01" 
     android:layout_height="wrap_content" android:layout_width="fill_parent" android:stretchMode="spacingWidthUniform"> 
     <TableRow android:id="@+id/TableRow01" android:layout_width="fill_parent" 
      android:layout_height="wrap_content"> 
      <Button android:layout_width="wrap_content" 
       android:layout_height="wrap_content" android:text="Settings" 
       android:id="@+id/btnSettings"></Button> 
      <Button android:text="@+id/Button01" android:id="@+id/Button01" 
       android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> 
      <Button android:text="@+id/Button02" android:id="@+id/Button02" 
       android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> 
     </TableRow> 
     <TableRow android:id="@+id/TableRow02" android:layout_width="fill_parent" 
      android:layout_height="wrap_content"> 
      <Button android:text="@+id/Button03" android:id="@+id/Button03" 
       android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> 
      <Button android:text="@+id/Button04" android:id="@+id/Button04" 
       android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> 
      <Button android:text="@+id/Button05" android:id="@+id/Button05" 
       android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> 
     </TableRow> 
    </TableLayout> 
관련 문제