0

Is it possible to scroll ScrollView that actually lay under ImageView using gestures?
Layout example:

<?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> 

If so, how to do it?

2 Answers 2

3

You need to pass the touchEvent from ImageView to ScrollView like below.

imageView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return scrollView.onTouchEvent(event); } }); 
Sign up to request clarification or add additional context in comments.

Comments

0

It looks like it works without any additional code :)
Video approve.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.