I have a vertical LinearLayout which has a list view and one ImageView at the bottom and one at top and the list view filled up the space left behind.
It looks like this:
<LinearLayout layout_height="match_parent" layout_width="@dimen/width"
orientation="vertical">
<ImageView layout_height="@dimen/width" layout_width="@dimen/width" id="@+id/top">
<ListView android:layout_height="0px"
android:background="#00ffff"
android:layout_width="@dimen/width"
android:layout_weight="1" />
<ImageView layout_height="@dimen/width" layout_width="@dimen/width" id="@+id/bottom" layout_gravity="bottom|center_horizontal">
It works fine whenever I have the list view visible.
But whenever I set the ListView to visibility gone, the 'bottom' ImageView will popup to be just underneath the top Image View.
My question is why the bottom ImageView does not stay at the bottom despite I said ' android:layout_gravity="bottom|center_horizontal"' I have looked at hierarchyViewer, the height of the parent does match the screen's height. So the bottom Image view should honor the android:layout_gravity="bottom|center_horizontal" and stay at the bottom, right?
ListView
to begone
, or can you get away with setting it toinvisble
? I'm pretty sure the latter will give you what you're looking for. – MH.