簡體   English   中英

設置版面背景更改版面大小

[英]Setting Layout Background Changes Layout Size

我有以下XML代碼:

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1.00"
        android:orientation="horizontal"
        android:weightSum="3.2" >

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="10dp"
            android:layout_weight="1"
            android:background="@drawable/addtrials"
            android:orientation="vertical" >

    </LinearLayout>  
            <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="10dp"
            android:layout_weight="1"
            android:orientation="vertical" >



    </LinearLayout>  
            <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="10dp"
            android:layout_weight="1"
            android:orientation="vertical" >

    </LinearLayout>  

    </LinearLayout>

如果不設置背景布局,就可以了,但是設置背景后,布局高度會變長,我不知道為什么會這樣。

任何幫助,將不勝感激

你有

 android:layout_weight="1" ,

如果圖像尺寸不同,則所有布局都將調整為新的內容。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM