UIScureView上的UIGestureRecognizer [英] UIGestureRecognizer over UIScrollView
本文介绍了UIScureView上的UIGestureRecognizer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当需要水平滚动时,我需要用3个手指检测UIScrollView上的左右滑动。我需要保持与1和2个手指的所有交互。是否有可能在不重写所有手势识别的情况下这样做。
I need to detect left and right swipe over a UIScrollView with 3 fingers when horizontal scrolling is possible. I need to keep all the interactions with 1 and 2 fingers. Is it possible to do that without rewrite all gesture recognision.
谢谢
推荐答案
这是可能的。向您的UIScrollView添加滑动手势并确保实现
It's possible. Add a swipe gesture to your UIScrollView and be sure to implement
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
所以他们不会互相取消。
So they will not cancel each other.
这篇关于UIScureView上的UIGestureRecognizer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文