设为首页 加入收藏

TOP

Android开发教程: 触摸屏模拟实现方向键
2014-11-24 13:51:37 来源: 作者: 【 】 浏览:1
Tags:Android 开发 教程 触摸屏 模拟 实现 方向

代码如下,需要注意的是MotionEvent的ACTION_DOWN, ACTION_UP 是这么理解的:


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


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.


ACTION_MOVE - A change has happened during a press gesture (between {@link #ACTION_DOWN} and {@link #ACTION_UP}). The motion contains the most recent point, as well as any intermediate points since the last down or move event. -


简而言之,ACTION_DOWN, ACTION_UP 类似于java script里面键盘事件OnKeyDown, OnKeyUp 或鼠标事件OnMouseDown, OnMouseUp, 而不是说手指往上划拉或往下划拉了一下。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Hibernate用Threadlocal实现多线程 下一篇Android源码如何和Eclipse关联

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: