Попробуйте установить для ScrollView
layout_height
что-то статичное, например 60dp
, и установите для layout_weight
значение 1.0
, что приведет к его расширению до максимума без отключения экрана.
<ScrollView
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_weight="1.0"
android:isScrollContainer="true"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true">
...
</ScrollView>
Это, однако, должно привести к тому, что кнопка «Выход» все время будет отображаться под ScrollView
.
. Чтобы кнопка появилась в нижней части ScrollView
, попробуйте переместить RelativeLayout
.внутри ScrollView
и вложив их в другой LinearLayout
примерно так:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bkgrnd">
<RelativeLayout
android:id="@+id/RelativeLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
... your header views ...
</RelativeLayout>
<ScrollView
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:isScrollContainer="true"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
... data you load ...
</LinearLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<Button
android:id="@+id/Logout"
android:text="@string/Logout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"></Button>
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>