onTouchEvent返回值的作用
来源:互联网 发布:经济学 知乎 编辑:程序博客网 时间:2024/05/18 03:47
关于返回值的问题,基本规则很清楚,如果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.
- onTouchEvent返回值的作用
- onTouchEvent返回值的作用
- view,viewGroup 的onTouchEvent返回值的作用
- OnTouchEvent的返回值
- boolean onTouchEvent(MotionEvent event) 返回值代表的意思:
- return 的返回值作用,
- return返回值的作用
- setOnLongClickListener 返回值的作用
- linux 返回值的作用
- Android中onTouchEvent的返回return super.onTouchEvent(ev);数组越界问题解决方法.。。
- update方法返回值的作用
- strcpy函数返回值的作用
- const作为函数返回值的作用
- 中断处理例程返回值的作用?
- strcpy函数返回值的作用
- 返回值的第二个作用
- Android onTouchEvent事件中onTouch方法返回值介绍
- Android onTouchEvent事件中onTouch方法返回值介绍
- 解决get请求方式乱码的方法
- 通比牛牛
- chrome中如何debug呢?
- ubuntu 16.04 安装QT问题
- JVM自动内存管理
- onTouchEvent返回值的作用
- java 匿名内部类说明 及其多线程实现继承Thread,实现Runnable
- Permission denied (publickey).
- Objective-C中Delegate,Protocol与Interface的区别
- Junit4的注意事项
- 健身补充蛋白
- string::append
- 50个PHP程序性能优化的方法
- c/c++ 结束进程