Макет, который я пытаюсь реализовать, (я думаю) довольно прост.
Один TextView расширяется в зависимости от того, что внутри. Ниже приведены две кнопки (ОК/Отмена).
Я могу заставить кнопки придерживаться нижней части экрана, и это работает отлично. Но я хотел бы иметь эти кнопки чуть ниже TextView. Я пробовал много разных вещей, но вот мой последний макет:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView android:id="@+id/Scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
>
<TextView
android:id="@+id/Text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</ScrollView>
<RelativeLayout android:id="@+id/buttons"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_below="@+id/Scroll"
android:layout_above="@+id/bottom"
>
<LinearLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<Button android:id="@+id/ButtonOK"
android:layout_height="80dp"
android:layout_width="fill_parent"
android:text="OK"
android:layout_weight="1"/>
<Button android:id="@+id/ButtonCancel"
android:layout_height="80dp"
android:layout_width="fill_parent"
android:text="Cancel"
android:layout_weight="1"/>
</LinearLayout>
</RelativeLayout>
<LinearLayout android:id="@+id/bottom"
android:layout_height="0px"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
Пустая линейная выгрузка в конце является попыткой (неудачной), чтобы предотвратить прохождение просмотра в нижней части экрана...
Во всем, что я пробовал, либо кнопки находятся в нижней части экрана, либо они будут проходить мимо, когда TextView слишком большой.
Вот эскиз того, что я пытаюсь сделать: