Как заставить ScrollView с RelativeLayout с несколькими дочерними раскладками заполнить экран?

У меня есть макет, в котором виден только ScrollView. Он имеет относительное расположение как его дочерний элемент. Этот макет имеет несколько других макетов (в основном, текстовых представлений) в качестве дочерних. Если текст недостаточно велик, представление прокрутки не расширяется до размера всего экрана. Вместо этого он показывает зазор внизу, где показан фон. Я попытался установить fillViewPort = true в ScrollView, но он только что создал первый дочерний макет (RL1) для заполнения экрана.

<?xml version="1.0" encoding="utf-8"?>
  <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background_image">

   <ProgressBar android:id="@+id/progressBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:visibility="gone"/>

    <ScrollView
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:fillViewPort="true"
      android:scrollbars="none">

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingTop="10px">

      <RelativeLayout android:id="@+id/list"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:paddingTop="10px">

        <!-- This layout is filling the screen if I set fillViewPort="true" -->
        <RelativeLayout  android:id="@+id/RL1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

            <!--TextViews and ImageViews -->

       </RelativeLayout>

        <RelativeLayout android:id="@+id/RL2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

            <!--TextViews and ImageViews -->

        </RelativeLayout>

        <RelativeLayout android:id="@+id/RL3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >

            <!--TextViews and ImageViews -->

        </RelativeLayout>

        <RelativeLayout  android:id="@+id/RL4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

            <!--TextViews and ImageViews -->

        </RelativeLayout>

     </RelativeLayout>

   </RelativeLayout>

  </ScrollView>

</FrameLayout>
5
задан terminator 20 August 2010 в 20:47
поделиться