2016-06-21 2 views
0
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 

    android:layout_height="140dp" 
    android:background="@color/colorPrimary"> 


    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="200dp" 
     android:layout_alignParentBottom="true" 
     android:layout_below="@+id/image" 
     android:layout_centerHorizontal="true" 
     android:fillViewport="true" 
     android:scrollbars="vertical" 

     > 


     <TextView 
      android:id="@+id/prayerMessage" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:padding="5dp" 
      android:text="please God forgive me for all my mistakes i have ever done in my life please God forgive me for all my mistakes i have ever" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:textColor="#ffffff" 

      /> 

    </ScrollView> 
</RelativeLayout> 

이것은 xml 파일이고 scrollview는 스크롤하지 않습니다.목록보기의 사용자 정의보기에서 Scrollview가 스크롤되지 않습니다.

누구든지 해결책을 제안 할 수 있습니까?

나는 당신의 스크롤 뷰의 사용자 정의 어댑터를

+0

는 XML 파일을 여기에 주어진 통해 동적 레이아웃 추가를 사용할 수 있습니까? ListView 항목? – Marat

+0

ListView 항목 인 것 같습니다 ... ListViews의 용도를 거의 사용하지 않기 때문에 ListViews 내에서 ScrollViews를 사용하지 않는 것이 좋습니다. StackOverflow 및 인터넷 전반에 대한 많은 게시물이 있습니다. 레이아웃에도 여러 다른 오류가 있습니다. RelativeLayout의 높이 설정은 scrollview보다 작습니다. 그러나 당신이 그것을 할지라도 중첩 된 스크롤을 지원하지 않는 중첩 된 스크롤링 컨테이너 덕분에 결과를 보지 못할 것입니다. –

답변

0

높이를 사용하여리스트 뷰에 대한 사용자 정의보기를 사용하고 200dp입니다. 200dp가 화면에 맞기 때문에 스크롤 할 것이 없습니다. 당신은 당신의 UI 항목의 높이가 화면 크기 다음보다 큰 경우

android:layout_height="match_parent" 

또는

android:layout_height="wrap_content" 

에 높이 설정을 시도 할 수 있습니다.

+0

그 중 하나도 작동하지 않습니다. –

1

서로 스크롤 가능한보기를 여러 개 사용하는 것은 좋지 않습니다. 목록보기에서 ScrollView를 사용하고 있으므로 안됩니다. 나쁜 습관입니다.

대신 당신은 view.add()

관련 문제