2

In my app i am using ScrollView for scrolling the ImageView, and i will add one customview dynamically to that ScrollView overlay of ImageView, i have onTouch events for customview. after adding to the scroll view i am not able to use the touch listeners of customview, still scrollview was working on that.

how to stop the scrollview touch listeners, and how to enable our custom view touch listeners..

5
  • Touch listeners events are not supported in ScrollView. Commented Sep 13, 2011 at 5:48
  • ok, this is my requirement: ImageView overlay CustomView for paint using finger, and scroll the image if it is larger than physical display. how to solve this. Commented Sep 13, 2011 at 5:55
  • @Balaji, is it possible or not to add a CustomView with touch listeners as a ScrollView Child.. Commented Sep 13, 2011 at 7:06
  • In question you are saying ScrollView as Parent and in above comment as Child?? Commented Sep 13, 2011 at 7:52
  • i.e customview child for scrollview Commented Sep 13, 2011 at 8:50

1 Answer 1

0

I suggest you not to go with ScrollView. Simply add your custom view in LinearLayout and implement OnGestureListener and then using GestureDetector you can able to listen all events(like onDown(),onFling(),onScroll(),onSingleTapUp(),onDown(),etc). You can sense scroll magnitudes and then by using scrollBy() method you can scroll your image(custom view). For more detilas you can refer following posts: Smooth scrolling in Android

Sign up to request clarification or add additional context in comments.

1 Comment

i have one more solution for scrolling by using onTouchListeners, but problem is i am not able to synchronous scrolling of imageview and customview. if i scroll imageview, not able to scroll the customview with same distance from x and y.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.