Trying to get a layout the way I want it. It contains a ListView and a LinearLayout which contains two TextViews.
The problem is with the ListView taking up the entire screen if it has more items then fits in one screen. In that case it doesn't show the View underneath it.
If I set the ListView to layout_weight=1 with layout_height=0dp then the View underneath it goes all the way to the bottom because the ListView fills the screen if not enough items are on it.
So how do I get a ListView with a View directly underneath it, so without setting it to the bottom of the screen?
As requested (but if the listview doesn't fit on one screen you don't get to see the view below listview):
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<ListView
android:id="@+id/list_bookings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
<LinearLayout
android:id="@+id/expected_cost_linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_regular">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:text="@string/expected_cost_label"
android:textStyle="bold" />
<TextView
android:id="@+id/expected_cost_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="..."
android:focusable="false" />
</LinearLayout>
</LinearLayout>