【UI】【View】MotionEvent类详解

7 篇文章 0 订阅
4 篇文章 0 订阅
本文将详细讲解MotionEvent类的一些成员和方法。
了解MotionEvent,可以更好地了解控件的一些特效,如拖动控件或多点缩放控件。同时,掌握MotionEvent类也是学好android触控技术的基础。


一、MotionEvent常见的常量

1)单点动作

ACTION_DOWN 

  A pressed gesture has started, the motion contains the initial starting location.

  public static final int ACTION_DOWN = 0;  单点触摸动作

ACTION_UP 

A pressed gesture has finished, the motion contains the final release location as well as any

intermediate points since the last down or move event.

public static final int ACTION_UP = 1;单点触摸离开动作

ACTION_OUTSIDE 

A movement has happened outside of the normal bounds of the UI element.

public static final int ACTION_OUTSIDE= 4;触摸动作超出边界

ACTION_CANCEL 

The current gesture has been aborted

public static final int ACTION_CANCEL = 3;触摸动作取消.

ACTION_MOVE 

A change has happened during a press gesture (between ACTION_DOWN and ACTION_UP).

public static final int ACTION_MOVE= 2;触摸点移动动作


2)多点动作

 ACTION_POINTER_DOWNpublic static final int ACTION_POINTER_DOWN = 5;  多点触摸动作
 ACTION_POINTER_UP public static final int ACTION_POINTER_UP = 6;    多点离开动作

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值