UIScrollView 与 UIPinchGesture
我有一个 UIScrollView ,上面附加了一个 UIPinchGesture 。我的问题是,如果我执行捏合手势,它会移动 UIScrollView,并且在 NSLogging UIScrollView 的 X/Y 时可以看到这一点。我想知道是否有人有任何想法来防止滚动视图上发生这种情况?
我已经设置了最小和最大缩放比例:
[scrollView setMaximumZoomScale: 1.0];
[scrollView setMinimumZoomScale: 1.0];
此外,我还对 UIScrollView 进行了子类化并实现了 TouchBegan 和 TouchEnded,但我不确定如果使用 2 个手指,我将如何忽略滚动视图上的触摸?
请指教。
I have a UIScrollView with a UIPinchGesture attached to it. My problem is though if I do a pinch gesture it moves the UIScrollView's and can see this when NSLogging the UIScrollView's X/Y. I was wondering if anyone has any ideas to prevent this happening on the scrollview?
I already set the minimum and maximum zoom scale:
[scrollView setMaximumZoomScale: 1.0];
[scrollView setMinimumZoomScale: 1.0];
Also I have subclasses the UIScrollView and implemented the touchesBegan and touchesEnded but I am unsure how I would ignore a touch on the scrollview if 2 fingers are used?
Please advise.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以明智地使用 ScrollEnabled 属性。
还要取消使用两根手指时的触摸,
you can wisely use ScrollEnabled property.
Also to cancel touch when two fingers are used,