gpt4 book ai didi

iphone - UIGestureRecognizer 通过 UIScrollView

转载 作者:行者123 更新时间:2023-12-03 18:38:04 25 4
gpt4 key购买 nike

当可以水平滚动时,我需要用 3 个手指检测 UIScrollView 上的左右滑动。我需要用 1 根和 2 根手指保留所有交互。是否可以在不重写所有手势识别的情况下做到这一点。

谢谢

最佳答案

这是可能的。向您的 UIScrollView 添加滑动手势并确保实现

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;

所以他们不会互相取消。

关于iphone - UIGestureRecognizer 通过 UIScrollView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6425785/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com