Reputation: 7824
I created a custom View that implements a GestureListener
and all the necessary logic to allow for some scrolling within the View. It works fine, as long as I do not put the View into some other scrollable View, e.g., a ScrollView
.
If I wrap my View with a ScrollView
, the touch events seem to be consumed by the ScrollView
completely and are not handed through to my custom View. How can I tell the ScrollView
that it should only consume touch events, if the touching happens outside of one of its children?
Upvotes: 0
Views: 332
Reputation: 3070
You can request your scrollable container to not intercept touch events from your View
by calling requestDisallowInterceptTouchEvent(true)
on it when you receive an ACTION_DOWN
event on your View
.
Upvotes: 1