2010-08-20 5 views
5

J'ai une mise en page qui a juste un ScrollView visible. Il a une disposition relative comme son enfant. Cette mise en page a plusieurs autres mises en page (principalement des vues de texte) comme ses enfants. Lorsque le texte n'est pas assez grand, la vue déroulante ne s'étend pas pour s'adapter à l'ensemble de l'écran. Au lieu de cela, il montre un écart au fond où l'arrière-plan montre. J'ai essayé de définir fillViewPort=true sur le ScrollView, mais cela a juste fait la première mise en page enfant (RL1) pour remplir l'écran.Comment faire ScrollView avec un RelativeLayout avec plusieurs mises en page enfant remplir l'écran?

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

Répondre

5

fillViewPort devrait être fillViewport

Questions connexes