【iOS】Swipe与Pan区别分析
By definition, a swipe gesture is necessarily also a pan gesture -- both involve translational movement of touch points. The difference is in the recognizer semantics: a pan recognizer looks for the beginning of translational movement and continues to report movement in any direction over time, while a swipe recognizer makes an instantaneous decision as to whether the user's touches moved linearly in the required direction.
根据定义,滑动手势也必然是平移手势 - 都涉及触摸点的平移运动。不同之处在于识别器语义:平移识别器查找平移运动的开始并继续报告随时间在任何方向上的移动,而滑动识别器立即决定用户的触摸是否在所需方向上线性移动。
By default, no two recognizers will recognize the same gesture, so there's a conflict between pan and swipe. Most likely, your pan recognizer "wins" the conflict because its gesture is simpler / more general: A swipe is a pan but a pan may not be a swipe, so the pan recognizes first and excludes other recognizers.
默认情况下,没有两个识别器会识别相同的手势,因此平移和滑动之间存在冲突。最有可能的是,你的pan识别器会赢得”冲突,因为它的手势更简单/更通用:滑动是一个平移但是平移可能不是一个滑动,所以平移首先识别并排除其他识别器。
You should be able to resolve this conflict using the delegate method gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:, or perhaps without delegation by making the pan recognizer depend on the swipe recognizer with requireGestureRecognizerToFail:.
您应该能够使用委托方法 gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:来解决此冲突,或者通过使pan识别器依赖于滑动识别器带有 requireGestureRecognizerToFail:。
With the conflict resolved, you should be able to simulate a one-finger swipe by quickly dragging the mouse. (Though as the mouse is more precise than your finger, it's a bit more finicky than doing the real thing on a device.) Two-finger pan/swipe can be done by holding the Option & Shift keys.
解决冲突后,你应该可以模拟一根手指通过快速拖动鼠标滑动。 (虽然鼠标比手指更精确,但它比在设备上做真实的东西更加挑剔。)双手平移/滑动可以通过按住Option& Shift键。
【iOS】Swipe与Pan区别分析的更多相关文章
- C++中关于[]静态数组和new分配的动态数组的区别分析
这篇文章主要介绍了C++中关于[]静态数组和new分配的动态数组的区别分析,很重要的概念,需要的朋友可以参考下 本文以实例分析了C++语言中关于[]静态数组和new分配的动态数组的区别,可以帮助大家加 ...
- Java中Comparable和Comparator接口区别分析
Java中Comparable和Comparator接口区别分析 来源:码农网 | 时间:2015-03-16 10:25:20 | 阅读数:8902 [导读] 本文要来详细分析一下Java中Comp ...
- Oracle nvchar2和varchar2区别分析
Oracle nvchar2和varchar2区别分析: [注意]VARCHAR2是Oracle提供的特定数据类型,Oracle可以保证VARCHAR2在任何版本中该数据类型都可以向上和向下兼容.VA ...
- jQuery中的.bind()、.live()和.delegate()之间区别分析
jQuery中的.bind()..live()和.delegate()之间区别分析,学习jquery的朋友可以参考下. DOM树 首先,可视化一个HMTL文档的DOM树是很有帮助的.一个简单的 ...
- jQuery中的bind() live() delegate()之间区别分析
jQuery中的bind() live() delegate()之间区别分析 首先,你得要了解我们的事件冒泡(事件传播)的概念,我先看一张图 1.bind方式 $('a').bind('click', ...
- addEventListener()及attachEvent()区别分析
Javascript 的addEventListener()及attachEvent()区别分析 Mozilla中: addEventListener的使用方式: target.addEventLis ...
- C# Parse和Convert的区别分析
原文:C# Parse和Convert的区别分析 大家都知道在进行类型转换的时候有连个方法供我们使用就是Convert.to和*.Parse,但是疑问就是什么时候用C 什么时候用P 通俗的解释大家都知 ...
- jquery中attr和prop的区别分析
这篇文章主要介绍了jquery中attr和prop的区别分析的相关资料,需要的朋友可以参考下 在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别 ...
- IOS跟ANDROID的区别
大家总是会纠结哪个手机系统会更加适合自己,那就由小编我简要介绍一下IOS和安卓的区别吧! 运行机制:安卓是虚拟机运行机制,IOS是沙盒运行机制.这里再说明一下这两者的主要不同之处.安卓系统中应用程序的 ...
随机推荐
- Python列表中的字典按照该字典下的键值进行排序
列表中的字典按照该字典下的键值进行排序 这算是排序中比较复杂的一种情况吧,多重嵌套,按照某种规则进行排序.如下面这个json(注:这里这是该列表中的一个项): [ { "stat" ...
- 在Eclipse中混合Java和Scala编程
1. 新建项目目录 scala-java-mix 2. 创建 src 目录及子目录: mkdir -p src/main/java mkdir -p src/main/scala 3. 在目录 sca ...
- ios 在APP内提示更新
http://www.jianshu.com/p/24daf5147bda ios如何在应用内部提示更新 两颗星 http://www.jianshu.com/p/2ba10a58bb02 ...
- 强化学习二:Markov Processes
一.前言 在第一章强化学习简介中,我们提到强化学习过程可以看做一系列的state.reward.action的组合.本章我们将要介绍马尔科夫决策过程(Markov Decision Processes ...
- vs code:sync setting 插件
sync setting 是同步设置插件 第一步:A机器上下载插件 第二步:通过git生成 token user(个人中心) --> Settings --> Developer sett ...
- intellij cpu占有高解决办法(亲测有效!)
File---Settings---Inspections---把勾都去掉或者选自己需要的部分.
- Test 1023 T1&T2
T1 popust (贪心 TimeLimit: 1000MS Memory Limit: 32768KB 米尔科饿了如熊,偶然发现当地一家餐馆.餐厅提供\(n\)种餐,有一个有趣的定价政策:每种 ...
- .Net C# 时间戳时间转换
闲话不多说,直接上代码 /// <summary> /// 时间拓展 /// </summary> public static class DateTimeExtension ...
- 初步了解JVM第二篇
在一篇<初步了解JVM第一篇>中,我们已经了解了: 类加载器:负责加载*.class文件,将字节码内容加载到内存中.其中类加载器的类型有如下: 启动类加载器(Bootstrap) 扩展类加 ...
- Python连载58-http协议简介
一.http协议实战 1.URL(Uniform Resource Located) (1)使用FFTP的URL,例如:ftp://rtfm.mit.edu (2)使用HTTP的URL,例如:http ...