ViewGroup事件分发

来源:互联网 发布:sql找不到存储过程 编辑:程序博客网 时间:2024/05/24 03:20

ViewGroup的事件分发核心也就是那几行伪代码,看了下源码发现自己写不出新鲜玩意,以下面的伪代码为思路看ViewGroup的事件分发

public boolean dispatchTouchEvent(MotionEvent ev){       boolean consume =false;   if(onIntercepTouchEvent(ev)){        consume = onTouch Event(ev);   }else{         consume = child.dispatchTouchEvent(MotionEvent ev);   }   return consume;}

原创粉丝点击