2011-08-10 11 views

答えて

5

これを試してみてください...あなたがやろうとしているものを達成するためにlayout_weightプロパティを使用することができます。..上の写真にあなたによって示されているよう 以下のレイアウトは、レイアウトを持つことになります。..

上記のコードで
<?xml version="1.0" encoding="utf-8"?><TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 
<TableRow> 
    <TableLayout android:layout_width="0dip" 
     android:layout_weight="2" android:layout_height="fill_parent"> 
     <TableRow android:layout_width="0dip" android:layout_weight="2" 
      android:layout_height="0dip"> 
      <View android:layout_width="0dip" android:layout_weight="1" 
       android:layout_margin="5dip" android:layout_height="fill_parent" 
       android:background="#fff"></View> 
      <View android:layout_width="0dip" android:layout_weight="1" 
       android:background="#eee" android:layout_margin="5dip" 
       android:layout_height="fill_parent"></View> 
     </TableRow> 
     <TableRow android:layout_width="0dip" android:layout_weight="2" 
      android:layout_height="0dip"> 
      <View android:layout_width="0dip" android:layout_weight="1" 
       android:background="#eee" android:layout_height="fill_parent" 
       android:layout_margin="5dip"></View> 
      <View android:layout_width="0dip" android:layout_weight="1" 
       android:layout_margin="5dip" android:layout_height="fill_parent" 
       android:background="#fff"></View> 
     </TableRow> 
    </TableLayout> 
    <TableLayout android:layout_width="0dip" 
     android:layout_weight="1" android:layout_height="fill_parent"> 
     <TableRow> 
      <View android:layout_width="0dip" android:layout_weight="1" 
       android:background="#bbb" android:layout_height="fill_parent"></View> 
     </TableRow> 

    </TableLayout> 
</TableRow> 

あなたがあそこたいものでビューを置き換える...

関連する問題