1

갤러리 등에서 ScrollViews에 대해 몇 가지 질문이 있지만, 여기에 정확히 반대되는 점이 있으며 해결책을 찾을 수 없습니다.ScrollView 내부의 갤러리 - 수직 스크롤링이 작동하지 않습니다.

문제점 : 하나의 ScrollView에 여러 개의 갤러리가 있습니다. 갤러리의 가로 스크롤링은 훌륭하게 작동합니다 (여기에서 변경된 사항은 없으며 SDK의 표준 갤러리 클래스). 그러나 ScrollView의 세로 스크롤링은 전체 활동에 적용되지 않습니다. 갤러리가 터치 이벤트를 가로 채는 것처럼 보입니다. 이 문제를 해결하도록 도와 주시겠습니까?

<ScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/scrollview_home" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fillViewport="true"> 
    <RelativeLayout 
     android:id="@+id/layout_home" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 
     <RelativeLayout 
      ...> 
      <Button 
       .../> 
      <Gallery 
       xmlns:android="http://schemas.android.com/apk/res/android" 
       android:id="@+id/gallery_..." 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       ... /> 
      <TextView 
       ... /> 
     </RelativeLayout>//this layout is repeated few times, because I have multiple galleries 
    </RelativeLayout> 
</ScrollView> 

감사 :

이 내 레이아웃 XML입니다!

+2

스크롤 가능한 물건을 다른 스크롤 가능한 물건에 안정적으로 넣을 수는 없습니다. – CommonsWare

+0

부모가 수직이고 자식이 수평이라도? – EyesClear

+1

다시, 문제는 * reliable *입니다. 예. 다른 방향으로 스크롤하는 무언가에 한 방향으로 스크롤하는 것을 넣는 경우가 있습니다. 같은 방향으로 스크롤하는 두 가지를 넣는 것은 거의 작동하지 않습니다. – CommonsWare

답변

1

상단 RelativeLayout (다른 모든 RelativeLayouts 포함)은 너비가 30-40dp 작고 ScrollView는 작게 만들 수 있습니다. 이렇게하면 사용자가 갤러리에서 다루지 않는 ScrollView 영역을 터치 할 수 있으므로 Touch는 가로 챌 수 없으므로 예상대로 작동해야합니다.