android中MotionEvent.ACTION_CANCEL事件如何被触发?
来源:互联网 发布:新华网络电视 编辑:程序博客网 时间:2024/05/22 00:38
对于这个问题,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 处理了就
- 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
- 计算机专业教学中的若干问题的思考——“计算机问题求解课”总结
- android屏幕触摸事件机制(转)
- android 实现欢迎界面
- Android ListView滑动过程中图片显示重复错乱闪烁问题解决
- 判断三角形与点的关系的一种实现
- android中MotionEvent.ACTION_CANCEL事件如何被触发?
- 易信PK微信
- 《Linux命令行与shell脚本编程大全》 第十四章 学习笔记
- 滚动到底部加载更多及下拉刷新listview的使用
- String 源码
- eclipse中的中文乱码问题
- NY--38 -- 布线问题 [prim算法求最小生成树]
- 随机数问题
- 鲁卡斯队列