/ / Einstellen des Layouthintergrunds Ändert die Layoutgröße - Java, Android, XML, Layout

Layout Layout Hintergrund Änderungen Layout-Größe - Java, Android, XML, Layout

Ich habe diesen XML-Code:

<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>

Ohne das Hintergrundlayout einzustellen, war es in Ordnung, aber nach dem Einstellen des Hintergrunds wird die Layouthöhe gedehnt und ich weiß nicht, warum das passiert.

Jede Hilfe wäre willkommen

Antworten:

0 für die Antwort № 1

Du hast

 android:layout_weight="1" ,

Wenn das Bild eine andere Größe hat, werden alle Layouts an den neuen Inhalt angepasst.