Веса макета не работают внутри ScrollView
Я хочу присвоить веса макета нескольким элементам вLinearLayout
внутриScrollView
, Тем не менееScrollView
игнорируетLinearLayout
weightSum
.
Моя цель - разделить макет с весами 2, 1, 1 (на общую сумму 4), но это не работает должным образом внутриScrollView
.
Как я могу решить эту проблему с макетом?
main.xml
<code><ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollView1" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:weightSum="4"> <LinearLayout android:id="@+id/logo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_weight="2" android:background="#FFFFFF" /> <LinearLayout android:id="@+id/logo1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_weight="1" android:background="#000000" /> <LinearLayout android:id="@+id/logobutton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="1" android:background="#4B4B4B" /> </LinearLayout> </ScrollView> </code>