2016-11-03 2 views
0

뷰 페이저 내부에서 사용되는 조각에서 스크롤 뷰를 사용하고 있습니다. 그러나 두루마리가 작동하지 않는 것 같습니다.뷰 페이저 조각 내에서 Scrollview가 작동하지 않음

<ScrollView 
     android:id="@+id/scrollview" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     > 
    <android.support.percent.PercentRelativeLayout 
     android:id="@+id/container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     > 
... 
... 
... 
</android.support.percent.PercentRelativeLayout> 
</ScrollView> 

이것은 조각의 레이아웃입니다. 하지만 스크롤이 전혀 작동하지 않는 것 같습니다.

답변

0

노력이

scrollview.setOnTouchListener(new View.OnTouchListener() { 
     @Override 
     public boolean onTouch(View v, MotionEvent event) { 
      v.getParent().requestDisallowInterceptTouchEvent(true); 
      return false; 
     } 
    }); 
0

당신은 "있는 ScrollView"그 아이 뷰에서 "wrap_parent"를 사용하려고 할 수 있습니다 :

안드로이드 : layout_height = "wrap_parent을"

0

만들기 스크롤 뷰 채우기 부모 높이와 너비가있는 상단 (즉 부모).

0

사용 NestedScrollView 다음과 같은 :

<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:id="@+id/scroll" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
app:layout_behavior="@string/appbar_scrolling_view_behavior" 
tools:context=".FragmentContactInfo"> 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 
    </LinearLayout> 
</android.support.v4.widget.NestedScrollView> 
관련 문제