0

私は1つの大きなLinearLayout(垂直)(外側のテーブル)と3つの小さな線形レイアウト(水平)(各行に1つ)を持っています。内部のlinearlayoutsがスペース全体を占有するようにします。現在、それらは必要なスペースのみを占有します。
これが私のコードです:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background">


<LinearLayout android:orientation="horizontal"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content">
    <ImageButton android:src="@drawable/Tag"
                 android:onClick="tagKillHandle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"/>
    <ImageButton android:src="@drawable/seekills" 
                 android:layout_width="wrap_content" 
                 android:onClick="seeKillsHandle" 
                 android:layout_height="wrap_content"/>       
</LinearLayout>

<LinearLayout android:orientation="horizontal"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content">
    <ImageButton android:src="@drawable/track"
                 android:onClick="trackMeHandle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"/>
    <ImageButton android:src="@drawable/taste"
                 android:onClick="tasteHandle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"/>           
</LinearLayout>

<LinearLayout android:orientation="horizontal"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content">
    <ImageButton android:src="@drawable/calls"
                 android:onClick="duckCallsHandle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"/>
    <ImageButton android:src="@drawable/faq"
                 android:onClick="faqHandle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"/>           
</LinearLayout>


</LinearLayout>

行が画面全体を占めるようにしたい。これどうやってするの?何か案は?

4

1 に答える 1

2

追加

android:layout_weight="1.0"

3 つの内部レイアウトのそれぞれで。

于 2011-08-09T16:03:21.050 に答える