2010-08-20 3 views
5

Tengo un diseño que tiene solo un ScrollView visible. Tiene un diseño relativo como su hijo. Este diseño tiene muchos otros diseños (principalmente vistas de texto) como sus elementos secundarios. Cuando el texto no es lo suficientemente grande, la vista de desplazamiento no se expande para ajustarse a toda la pantalla. En cambio, muestra un espacio en la parte inferior donde se muestra el fondo. Intenté configurar fillViewPort=true en ScrollView, pero eso solo hizo que el primer diseño secundario (RL1) ocupara la pantalla.¿Cómo hacer ScrollView con un RelativeLayout con múltiples diseños secundarios llenan la pantalla?

<?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> 

Respuesta

5

fillViewPort debe ser fillViewport

Cuestiones relacionadas