Я хочу сделать экран с TextView сверху (заголовок) ListView посередине и кнопки внизу.Как разместить ListView, который заполнит все пространство между верхним TextView и нижними кнопками и сможет прокручивать его содержимое?
Теперь, когда мой список растет, он нажимает нижнюю кнопку за пределами экрана.
У меня есть:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<Button android:id="@+id/button1"
android:layout_height="wrap_content"
android:text="Button"
android:layout_width="wrap_content"
/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:layout_alignParentBottom="true"
/>
<ListView android:id="@+id/lvLocations"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView android:layout_height="0dip"
android:layout_width="fill_parent"
android:layout_weight="1"
/>
<Button android:text="LayerDrawable"
android:id="@+id/button5"
android:textSize="15dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:background="@drawable/layer_drawable"
/>
</LinearLayout>
Последний TextView
используется, чтобы сделать пробел и переместиться Button
к основанию.