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

Balaji Khadake
  • 3,449
  • 4
  • 24
  • 38
RajaReddy PolamReddy
  • 22,428
  • 19
  • 115
  • 166

1 Answers1

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

Community
  • 1
  • 1
Balaji Khadake
  • 3,449
  • 4
  • 24
  • 38
  • 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. – RajaReddy PolamReddy Sep 13 '11 at 08:54