[英]Zooming on content view inside of scrollview doesn't work
I'm creating a scrollview with content view inside of it. 我正在创建一个带有内容视图的滚动视图。 inside of the content view there are buttons.
内容视图内部有按钮。
from this point, i already can zoom and pan on content view. 从这一点来看,我已经可以缩放和平移内容视图了。 but when the touch happen on a button the scrollview doesn't zoom.
但是当触摸按钮时,滚动视图不会缩放。
I have just had the same problem and solved it with the following steps : 我刚刚遇到了同样的问题,并通过以下步骤解决了这个问题:
isUserInteractionEnabled = false
) on the button. isUserInteractionEnabled = false
)。 delaysContentTouches = true
delaysContentTouches = true
The UIScrollView should be able to now seamlessly zoom and you can respond to your buttons. UIScrollView现在应该能够无缝缩放,并且您可以响应按钮了。
You can skip the button altogether if you want and just handle the Tap in the Gesture Recognizer. 如果需要,可以完全跳过该按钮,而只需在手势识别器中处理“点击”即可。 I had to do it the way above because the buttons were a custom sub classed buttons and had a lot of additional custom rendering and functionality included.
我必须按照上面的方法进行操作,因为这些按钮是自定义子类别的按钮,并且还包含许多其他自定义呈现和功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.