You can set the top view android:layout_weightto "1", then you can set the bottom height of the view, and the top view will take up all the remaining space. For example:
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="25dip" />
(Of course, if there is content in the lower view, you can simply set the height to "wrap_content" and set its own size based on its content.)
source
share