UIScrollView 在缩放或滚动时阻止所有触摸 [英] UIScrollView blocks all touches while zooming or scrolling

查看:35
本文介绍了UIScrollView 在缩放或滚动时阻止所有触摸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当 UIScrollView 使用捏合手势或滚动进行缩放时,我无法按下同一窗口中的任何其他按钮.有什么办法可以启用这种行为吗?就像滚动视图具有独占触摸功能一样(尽管我尝试将其显式设置为 NO).我在视图中有一个滚动视图,我希望它仅在用户按住滚动按钮时滚动.否则,用一根手指平移可以实现徒手绘制.

I can't press any other buttons in the same window while UIScrollView is zooming with a pinch gesture or scrolling. Is there any way to enable this behavior? It's exactly like the scroll view has exclusive touch (though I tried setting it explicitly to NO). I have a scroll view inside a view, and I would like it to scroll only while the user holds a scroll button. Otherwise, panning with one finger enables freehand drawing.

推荐答案

如评论中所述,答案是我愚蠢地在滚动视图的子视图中启用了 exclusiveTouch 的子视图.

As noted in the comments, the answer was that I foolishly had a subview that had exclusiveTouch enabled among the subviews of the scroll view.

这篇关于UIScrollView 在缩放或滚动时阻止所有触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆