从单独的android文档我真的不明白ACTION_UP和ACTION_POINTER_UP之间的区别。 http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_DOWN
基本上我想捕获一个手指从屏幕上释放的事件(即使另一个手指仍然可以触摸它)
谢谢!
from the android doc alone i dont really understand the difference between ACTION_UP and ACTION_POINTER_UP. http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_DOWN
basically i want to capture the event when one finger is released from the screen (even if another one may still be touching it)
thanks!
最满意答案
我相信这是源自添加了多点触控,ACTION_UP自API Level 1开始,但在添加多点触控时添加了ACTION_POINTER_UP。
你得到的结果将取决于你调用的方法,getAction()将返回ACTION_UP,而getActionMasked()会给ACTION_POINTER_UP,但也允许你调用getActionIndex()来找出哪些多点触控指针刚被引发。 我认为这是你想要做的。
I believe it stemmed from Multi-touch being added in, ACTION_UP has been in since API Level 1, but ACTION_POINTER_UP was added in API Level 5 when multi-touch was added.
The result you get will depend on which method you are calling, getAction() would return ACTION_UP whereas getActionMasked() would give ACTION_POINTER_UP but also allow you to call getActionIndex() to find out which of the multi-touch pointers has just been raised. I think this is what you want to do.
更多推荐
发布评论