2016-07-19 7 views
0

実際にImageViewのジェスチャーを使用して表示されるScrollViewをスクロールすることはできますか?
レイアウト例:もしそうならImageViewのScrollViewをスクロール

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    > 
    <ScrollView 
     android:id="@+id/sv_scroll" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
     <LinearLayout 
      android:id="@+id/ll_content" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 
      <!--..some content..--> 
     </LinearLayout> 
    </ScrollView> 
    <ImageView 
     android:id="@+id/iv_image" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:scaleType="fitXY" 
     android:src="@drawable/image" 
     /> 
</FrameLayout> 

は、どのようにそれを行うには?

答えて

0

それは、追加のコード:)
Video approveずに働くように見えます。

3

ImageViewからtouchEventをScrollViewに渡す必要があります。

imageView.setOnTouchListener(new View.OnTouchListener() { 
    @Override 
    public boolean onTouch(View v, MotionEvent event) { 
     return scrollView.onTouchEvent(event); 
    } 
}); 
関連する問題