android中MotionEvent.ACTION_CANCEL事件是什么意思,如何触发
来源:互联网 发布:裁剪人物图片的软件 编辑:程序博客网 时间:2024/05/22 07: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 处理了就
最后总结下,就是触摸某个控件,但是又不是在这个控件的区域上抬起(移动到别的地方了),就会出现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事件如何被触发?
- 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
- OpenGL ES Programming Guide for iOS
- OpenGL的版本历史和发展
- 做好自已,战胜自已
- DT大数据梦工厂 温故而知新 之25讲
- DT大数据梦工厂 温故而知新 之26讲
- android中MotionEvent.ACTION_CANCEL事件是什么意思,如何触发
- 问题点0807------框架设计中的一些调整
- unity3d 随机生成地形之随机山脉
- UE3粒子系统参考指南
- JSP九大隐式对象
- Node.js开发入门—Express安装与使用
- UE4 Particle Systems
- FragmentPagerAdapter与FragmentStatePagerAdapter区别
- ASPxPopupControl 弹窗不显示上一次内容的方法