当前位置: 首页 > news >正文

php+mysql网站开发...潍坊seo网络推广

php+mysql网站开发...,潍坊seo网络推广,建设网站需要多少钱济南兴田德润地址,安全狗 网站打不开原文地址#xff1a;http://android.xsoftlab.net/training/gestures/multi.html 多点触控是指多个手指同时触摸屏幕的情况。这节课主要学习如何检测多点触控手势。 记录多个触控点 当多根手指同时触碰到屏幕时#xff0c;系统会产生以下触摸事件#xff1a; ACTION_DOW…原文地址http://android.xsoftlab.net/training/gestures/multi.html 多点触控是指多个手指同时触摸屏幕的情况。这节课主要学习如何检测多点触控手势。 记录多个触控点 当多根手指同时触碰到屏幕时系统会产生以下触摸事件 ACTION_DOWN -第一个触碰到屏幕的点。它是手势的起始事件。这个触控点的指针数据在MotionEvent对象中的索引总是0。ACTION_POINTER_DOWN -除第一个触控点之外的其它点。这个触控点的指针数据的索引由getActionIndex()方法返回。ACTION_MOVE -屏幕上的手指位置发生变化时。ACTION_POINTER_UP -除最开始按下的其它触控点离开屏幕时。ACTION_UP -最后一个触控点离开屏幕时。 我们可以通过每一个触控点对应的索或ID来追踪MotionEvent对象中的每一个触控点 Index: MotionEvent对象将触控点的相关信息存储于一个数组中。每一个触控点的索引则是这个触控点在数组中的相对位置。MotionEvent对象的大多数方法都可以使用这些索引来与这些点产生交互。ID: 每一个触控点也含有一个ID映射这个映射关系在手势事件的整个生命周期内与相对应的触控点一直保持相对关系。 每个触控点的出现顺序是不固定的。因此触控点的索引可以由事件转移到下一个索引但是触控点的ID始终保持为一个常量。使用getPointerId()方法可以获得指定触控点的ID因此可以在余下的手势事件中还可以继续保持与这个触控点的联系。使用findPointerIndex()方法可以根据指定的ID获得触控点的索引 private int mActivePointerId; public boolean onTouchEvent(MotionEvent event) {....// Get the pointer IDmActivePointerId event.getPointerId(0);// ... Many touch events later...// Use the pointer ID to find the index of the active pointer // and fetch its positionint pointerIndex event.findPointerIndex(mActivePointerId);// Get the pointers current positionfloat x event.getX(pointerIndex);float y event.getY(pointerIndex); } 获取事件的活动 使用getActionMasked()方法可以获取MotionEvent的活动。与getAction()方法不同getActionMasked()适用于多个触控点。它会返回正在执行的活动。你可以使用getActionIndex()方法获得与之相关联的触控点的索引。下面的代码演示了这个过程 Note: 示例中使用了MotionEventCompat类。这个类位于支持库中。你应该使用该类以便提供良好的向后兼容性。注意MotionEventCompat类并不可以替代MotionEvent类。这个类提供了一个实用的静态方法可以将MotionEvent对象所关联的活动提取出来。 int action MotionEventCompat.getActionMasked(event); // Get the index of the pointer associated with the action. int index MotionEventCompat.getActionIndex(event); int xPos -1; int yPos -1; Log.d(DEBUG_TAG,The action is actionToString(action));if (event.getPointerCount() 1) {Log.d(DEBUG_TAG,Multitouch event); // The coordinates of the current screen contact, relative to // the responding View or Activity. xPos (int)MotionEventCompat.getX(event, index);yPos (int)MotionEventCompat.getY(event, index); } else {// Single touch eventLog.d(DEBUG_TAG,Single touch event); xPos (int)MotionEventCompat.getX(event, index);yPos (int)MotionEventCompat.getY(event, index); } ... // Given an action int, returns a string description public static String actionToString(int action) {switch (action) {case MotionEvent.ACTION_DOWN: return Down;case MotionEvent.ACTION_MOVE: return Move;case MotionEvent.ACTION_POINTER_DOWN: return Pointer Down;case MotionEvent.ACTION_UP: return Up;case MotionEvent.ACTION_POINTER_UP: return Pointer Up;case MotionEvent.ACTION_OUTSIDE: return Outside;case MotionEvent.ACTION_CANCEL: return Cancel;}return ; } 有关多点触控的更多信息可以参见课程Dragging and Scaling.
http://www.huolong8.cn/news/412727/

相关文章:

  • html5素材网站wordpress 破解商场主题
  • 装修设计师网站网站建设静态部分总结
  • 找人做网站应该注意什么中国建设银行官网官网
  • 徐州网站建设工作室中石建基础设施建设有限公司网站
  • 软件系统开发报价表免费外链网站seo发布
  • 怎么用wordpress仿站怎样做企业的网站建设
  • 网站建设网站优化相关资讯文章做防护用品的网站
  • 网站开发收费标准如何搭建自己的网站
  • 黄山网站建设哪家强wordpress添加博客栏目
  • 做网站的软件是什么猪八戒网站开发合同
  • 上海奉贤 网站建设方圆网 网站建设
  • 门户网站建设采购网站建设都需要买什么东西
  • 宁波住房建设局网站湖南网站建设 尖端磐石网络
  • 设计高端网站哪家好高端品牌推广方案
  • 高端网站开发公司产业协会建设网站方案
  • 浏览网站内下载文件前端培训找不到工作的多吗
  • 工作室网站开发wordpress 仿虎嗅主题
  • 网站开发与编程的区别盛泽做网站
  • 网站建设要学产品vi设计都包括什么
  • 凡科做的网站手机版电话卡代理平台
  • 温州哪里有网站济南造价工程信息网
  • 深圳外贸网站公司网页制作素材按钮图标
  • 河南襄县做网站的公司wap医院网站模板 for dedecms v1.0
  • wordpress站怎么优化菏泽网站建设报价
  • 网站排名软件网址网上开店指南
  • 做网站切图的原则是什么国际十大公关公司
  • ftp上传网站后怎么弄wordpress答题跳转
  • 学校网站报价方案网站开发三大流行语言
  • 校园学生网站开发模板网字体库免费
  • wordpress 获取插件数据兰州网站建设优化制作公司