开发者

Android MotionEvent - Cant find Left and Right Motion Event

开发者 https://www.devze.com 2023-01-05 03:45 出处:网络
i am developing one application in which there is an imageview...in which i want to move left or right using mouse touch...

i am developing one application in which there is an imageview...in which i want to move left or right using mouse touch...

for that i found "android.view.MotionEvent" but in MotionEvent there are few events among that

  1. ACTION_CANCEL 2. ACTION_DOWN 3. ACTION_UP ......etc.

hence there is no such event for "LEFT" and "RIGHT" action....

开发者_Go百科so is there any other way to implement the "LEFT" and "RIGHT" move ??


You misunderstood MotionEvent class events. ACTION_DOWN, ACTION_UP are equal to pressed and unpressed events.

In order to detect events like LEFT and RIGHT swipe, you have to use Gesture Recognition. Try to follow this example.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号