Android + When to use onInterceptTouchEvent()?
Sorry if this is vague, but can someone please give me an example of when to use onInterceptTouchEvent()
?
I understand the concept, intercepting child view touches in the parent ViewGroup
, but why would I need to do tht?
Example usage might help me to better understand it.
When: handler touch event in parent before the event dispatch to the child.
How: create a class extents from ViewGroup(like LinearLayout ...) class and override the onInterceptTouchEvent(), the you can process something you want in the method.
see: the-order-of-click-event-handled-by-parent-view-and-child-view
精彩评论