LinearLayout minHeight not working with weigth=“1”

Andreas72

New Member
I tried the all afternoon to get the \[code\]minHeight\[/code\] attribute to work. What I want is the \[code\]linearMe\[/code\] layout to:
  • Stretch from the bottom of the screen to the bottom of the ListView when the ListView has just a few elements.
  • I need to be able to fill the linearMe layout with a picture for example.
As the ListView gets bigger I want the \[code\]linearMe\[/code\] layout to:
  • Have a fixed height (while being at the bottom of the screen) and the ListView to allow scrolling.
My problem is that the the \[code\]linearMe\[/code\] layout is smaller and smaller as there is more elements in the ListView. And when there is enough element for the listView to fill the screen, the \[code\]linearMe\[/code\] layout is just gone. It looks like the \[code\]minHeight\[/code\] is useless in this case.\[code\] <LinearLayout android:layout_width="match_parent" android:orientation="vertical" android:layout_height="match_parent" > <ListView android:id="@+id/list" android:layout_width="match_parent" android:layout_height="wrap_content" /> <LinearLayout android:id="@+id/linearMe" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="#FF0000" android:minHeight="200dp" /> </LinearLayout>\[/code\]
efTMg.png
MS53S.png
I hope you can help me out ! :)
 
Back
Top