view,viewGroup 的onTouchEvent返回值的作用
来源:互联网 发布:qq防沉迷解除软件 编辑:程序博客网 时间:2024/06/08 02:16
版权声明:本文为博主原创文章,未经博主允许不得转载。
关于返回值的问题,基本规则很清楚,如果return true,那么表示该方法消费了此次事件,如果return false,那么表示该方法并未处理完全,该事件仍然需要以某种方式传递下去继续等待处理。
SDK给出的说明如下:
· You will receive the down event here.
· The down event will be handled either by a child of this view group, or given to your own onTouchEvent() method to handle; this means you should implement onTouchEvent() to return true, so you will continue to see the rest of the gesture (instead of looking for a parent view to handle it). Also, by returning true from onTouchEvent(), you will not receive any following events in onInterceptTouchEvent() and all touch processing must happen in onTouchEvent() like normal.
· For as long as you return false from this function, each following event (up to and including the final up) will be delivered first here and then to the target's onTouchEvent().
· If you return true from here, you will not receive any following events: the target view will receive the same event but with the action ACTION_CANCEL, and all further events will be delivered to your onTouchEvent() method and no longer appear here.
- view,viewGroup 的onTouchEvent返回值的作用
- onTouchEvent返回值的作用
- onTouchEvent返回值的作用
- OnTouchEvent的返回值
- View,ViewGroup,Activity三者的OnTouchEvent事件分发
- View 的 onTouchEvent 方法
- android ViewGroup的onInterceptTouchEvent 和 onTouchEvent事件
- ViewGroup的touch事件:dispatchTouchEvent、onInterceptTouchEvent、onTouchEvent
- ViewGroup onInterceptTouchEvent,ViewGroup onTouchEvent,View onTouchEvent执行顺序说明
- ViewGroup onInterceptTouchEvent,ViewGroup onTouchEvent,View onTouchEvent执行顺序说明
- ViewGroup onInterceptTouchEvent,ViewGroup onTouchEvent,View onTouchEvent执行顺序说明
- View/ViewGroup的"生命周期"
- ViewGroup类的作用
- View的onTouch()与onTouchEvent()
- View 和 ViewGroup的分析
- View和ViewGroup的理解
- view和viewgroup的详解
- View 和 ViewGroup 的 hasFocusable
- 团队开发之:eclipse自动格式化代码formatter使用方式
- 设计模式——单例模式 Java源代码
- Gradle Notes
- tcp与udp的异同点
- 【C语言】输出从公元1000年至2000年所有闰年的年号,每输出3个年号换一行!
- view,viewGroup 的onTouchEvent返回值的作用
- ubuntu系统自带的火狐(firefox)如何安装Adobe Flash
- Unix C 常遇错误解决
- python学习之类特殊方法定制 __add__,__iadd__,__radd__
- 8天学通MongoDB——第一天 基础入门
- 华为机考Java版
- future 模式
- POJ 3735 Training Little Cats
- 8天学通MongoDB——第二天 细说增删查改