开发者

Rows to take up the entire screen

开发者 https://www.devze.com 2023-03-26 20:04 出处:网络
I have one big LinearLayout(vertical)(outer table) and three small linear layouts(horizontal)(one for each row). I want the linearlayouts inside to take up the entire space. Currently they take up onl

I have one big LinearLayout(vertical)(outer table) and three small linear layouts(horizontal)(one for each row). I want the linearlayouts inside to take up the entire space. Currently they take up only the required space.

Here is my code:

<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_pa开发者_运维问答rent"
              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>

I want the rows to take up the entire screen. How can I do this? Any ideas?


Add

android:layout_weight="1.0"

in each of the three inner layouts.

0

精彩评论

暂无评论...
验证码 换一张
取 消