2010-08-20 1 views
5

나는 ScrollView 만 보이는 레이아웃이 있습니다. 자식으로 상대 레이아웃이 있습니다. 이 레이아웃에는 여러 다른 레이아웃 (주로 텍스트보기)이 하위로 있습니다. 텍스트 크기가 충분하지 않으면 스크롤보기가 전체 화면에 맞게 확장되지 않습니다. 대신, 배경에 나타나는 아래쪽에 간격이 표시됩니다. ScrollView에서 fillViewPort=true 설정을 시도했지만 방금 첫 번째 자식 레이아웃 (RL1)을 만들어 화면을 채 웁니다.여러 자식 레이아웃이있는 RelativeLayout을 사용하여 ScrollView를 만드는 방법은 화면을 채우고 있습니까?

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

fillViewPort이어야 fillViewport

관련 문제