android中MotionEvent.ACTION_CANCEL事件如何被触发?
来源:互联网 发布:网络小说完本排行榜 编辑:程序博客网 时间:2024/05/22 10:46
对于这个问题,android文档的说明很简短,想看明白很难。国外一网页说的还比较详细,写在这里分享给大家:
原文是这样的:
You receive this when a parent takes possession of the motion, for example when the user has dragged enough across a list view or scroll view that it will start scrolling instead of letting you press the buttons inside of it.
意思是这样的:
当你的手指(或者其它)移动屏幕的时候会触发这个事件,比如当你的手指在屏幕上拖动一个listView或者一个ScrollView而不是去按上面的按钮时会触发这个事件。
在设计设置页面的滑动开关时,如果不监听ACTION_CANCEL,在滑动到中间时,如果你手指上下移动,就是移动到开关控件之外,则此时会触发ACTION_CANCEL,而不是ACTION_UP,造成开关的按钮停顿在中间位置。
意思就是,当用户保持按下操作,并从你的控件转移到外层控件时,会触发ACTION_CANCEL,建议进行处理~
当前的手势被中断,不会再接收到关于它的记录。
推荐将这个事件作为 ACTION_UP 来看待,但是要区别于普通的 ACTION_UP
话说回来,平常还真碰不到这个事件,习惯上就直接当 ACTION_UP 处理了就
0 0
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- android中MotionEvent.ACTION_CANCEL事件是什么意思,如何触发
- android MotionEvent.ACTION_CANCEL情景分析
- ACTION_CANCEL事件的触发条件
- Android 模拟MotionEvent事件 触发输入法
- android MotionEvent.obtain模拟事件,自动触发
- Android 模拟MotionEvent事件 触发输入法
- Android MotionEvent.ACTION_UP和ACTION_CANCEL的区别
- android view 中 MotionEvent 及其事件处理
- Android中触摸事件MotionEvent的来源
- 安卓-MotionEvent之ACTION_CANCEL
- jascript中常见的几个兼容问题
- xxx.h file not found
- weblogic中文乱码与locale的关系
- OCP-1Z0-051-2015-49题
- cannot assign value of type
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- 数据库搜索 按照时间条件
- Oracle批量导出表数据到CSV文件
- android 动画总结(利用属性动画做一个波浪)
- QPSK、16QAM、64QAM
- HOG C实现,验证通过
- Swift中延迟属性@lazy
- Github-iOS备忘
- OCP-1Z0-051-2015-50题