Это расположение XML я работаю над:Android: странный вес инверсия в LinearLayout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:orientation="vertical" >
<ScrollView
android:layout_weight="2"
android:id="@+id/scrollConfirm"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ScrollView>
<LinearLayout
android:layout_marginTop="20px"
android:layout_weight="1"
android:id="@+id/imageNumpad"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:src="@drawable/myicon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#FFFFFF"
/>
</LinearLayout>
</LinearLayout>
Поскольку я выставиться в Scrollview с layout_weight="2"
и LinearLayout (ребенка) с layout_weight="1"
я ожидал, что будет ScrollView используйте дважды свободное пространство, которое LinearLayout. Но я получаю противоположный результат. ScrollView меньше LinearLayout. Принимая во внимание, что для набора ScrollView layout_weight="1"
и LinearLayout с layout_weight="2"
, ScrollView больше LinearLayou.
Как это возможно ???