Open halatmit opened 9 years ago
@halatmit , wrap_content only takes minimum area required, and fill parent fills the whole area it's parent has.
http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#FILL_PARENT
And consider it a concept or bug, layout containing,
<LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content"
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="haha"
/>
<LinearLayout
android:layout_height="fill_parent"
android:layout_width="wrap_content"
android:orientation="vertical"
>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="text1"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="text2"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="text3"
/>
</LinearLayout>
</LinearLayout>
is not working properly in android.
@halatmit In the aia project, the Horizontal Arrangement's layout height is stetted as Automatic, and the inner Vertical Arragement's layout height is stetted as Fill Parent.
In the below explanation from source code, it says that actual height of the horizontal arrangement is determined by the tallest component whose height property is not set to Fill Parent.
In this project, because there is a button, whose height property is Automatic, in the Horizontal Arrangement layout, the height of horizontal arrangement is determined by button then instead of inner Vertical Arrangement
I'm not sure what the root cause is, but a vertical arrangement of height fill parent sitting inside a horizontal arrangement of height automatic doesn't seen to be doing the right thing.
The following project illustrates the bug
people.csail.mit.edu/hal/misc/horizVertsizeBug.aia