How to Handle TouchEvents for Child View(CustomView) in Parent View (ScrollView)?

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.

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.

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. – PolamReddyRajaReddy Sep 13 at 8:54.

When a child handles the onClick, the parent does not receive the event. If you want to see the parent get the event, don't set an onClickListener on the child. OnTouch events are handled a bit differently.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions