1、事件分发有哪几个事件:

2、事件分发涉及到3个组件:activity,view,viewGroup
事件分发涉及到3个方法:dispatchTouchEvent,onTouchEvent,onInterceptTouchEvent。这几个方法返回true,表示自己消费事件,事件不会再向下传递。
3、组件和方法:

4、3个分发事件方法(dispatchTouchEvent,onTouchEvent,onInterceptTouchEvent)都为false时流程:
Activity: dispatchTouchEvent--->
ViewGroup: dispatchTouchEvent--->onInterceptTouchEvent--->
View: dispatchTouchEvent--->
注:以下开始向上逐层调用
View: onTouchEvent--->
ViewGroup: onTouchEvent--->
Activity: onTouchEvent--->
网友评论