android中MotionEvent.ACTION_CANCEL事件如何被触发?
来源:互联网 发布:淘宝店铺怎样分类宝贝 编辑:程序博客网 时间:2024/05/22 09:39
对于这个问题,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
- Common-collections
- xslt中的apply-template和call-template的区别
- 还好我们有朋友-蝌蚪
- 08.栈(二)栈的应用
- CF22B 最大子矩阵问题简单版
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- jq弹出层与自动隐藏,屏幕居中显示,弹出层的移动原理
- c++ 正则表达式
- goto语句(转)
- mysql字符串连接函数
- 数字万用表使用方法
- 也说说谭浩强
- Live555接收H264流判断关键帧
- Linux I2C驱动分析(二)----I2C板级设备扫描和数据传输