2011-07-01 11 views
0

다음 XML 파일이 목록보기를 통해 채워집니다. 나는 그것을 스크롤 할 수 없습니다. 제발 조언 :Android : ScrollView가 스크롤되지 않습니다.

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
android:orientation="vertical" 
android:id="@+id/BigLayout" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 

<ScrollView 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:fillViewport="true" 
    android:scrollbars="vertical"> 

    <LinearLayout 
     android:orientation="vertical" 
     android:id="@+id/myMainLayout" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 

     <com.google.ads.AdView android:id="@+id/adViewer" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      ads:adUnitId="xxxxxxxxxxxxxx" 
      ads:adSize="BANNER" 
      ads:loadAdOnCreate="true"/> 
     <TextView 
      android:layout_height="wrap_content" 
      android:layout_width="fill_parent" 
      android:text="RandomDrunkQuotes.com" 
      android:id="@+id/lblTitle" 
      android:textSize="16px" 
      android:padding="5px" 
      android:textStyle="bold" 
      android:gravity="center_horizontal"/> 

     <!-- List Divider --> 
     <View 
      android:layout_width="fill_parent" 
      android:layout_height="1dip" 
      android:background="?android:attr/listDivider" /> 
     <!-- ListView (grid_items) --> 
     <ListView 
      android:id="@+id/listview" 
      android:layout_height="fill_parent" 
      android:layout_width="fill_parent"> 
     </ListView>    

    </LinearLayout> 

</ScrollView> 

</LinearLayout> 
+2

ScrollView가 필요한 특별한 이유가 있습니까? LinearLayouts는 자식 뷰가 화면보다 더 많은 공간을 차지한다면 본질적으로 스크롤하는 기능을 가지고 있습니다. – kibibyte

+0

이 레이아웃으로 어떤 행동을 시도하고 있습니까? ListView를 ScrollView 안에 두지 말아야합니다. –

+1

ScrollView noramlly가 수직 방향으로 작동하고 별도의 HorizontalScrollView가 있다는 것을 명심하십시오. – Vlad

답변

1

@ 자이언트 마시 멜로 그것을 해결하십시오. 스크롤 뷰를 제거하고있는 LinearLayout 내 문제를 해결 부모에게

android:fillViewport="true" 
android:scrollbars="vertical" 

를 추가하면

. 귀하의 의견을 진심으로 감사드립니다.

0

scrollView의 ListView는 그리 나쁜 생각입니다. 집중 뷰를 사용하지 마십시오.

관련 문제