Gram z opcją measureWithLargestChild="true"
. Nie rozumiem, dlaczego mój układ łamie się całkowicie, jeśli jeden z moich przycisków ma na nim zbyt duży tekst. Myślę, że powinien zachować podstawowy rozmiar 1/3, ale zmniejsza się o 1/6. Dlaczego?Opis pomiaruWithLargestChild: Dlaczego łamie układ?
Tutaj można zobaczyć kilka zrzutów ekranu:
Oto mój xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:baselineAligned="false"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:measureWithLargestChild="true" >
<Button
style="@style/my_style"
android:layout_weight="1"
android:text="Button123456" />
<Button
style="@style/my_style"
android:layout_weight="1"
android:text="A" />
<Button
style="@style/my_style"
android:layout_weight="1"
android:text="WW" />
</LinearLayout>
</LinearLayout>
Czy ktoś może wyjaśnić, dlaczego jest skurczony w przypadku 2 (na 4 przypadki). Dlaczego nie ma w tym przypadku miejsca? – Diffy