开发者

Android MotionEvent - Cant find Left and Right Motion Event

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜