[英]ScrollView - Send Touches to View below
My setup - and I cannot change it - is right now: 我的设置-我无法更改它-现在:
Root View 根视图
- UIView -UIView
-- ScrollView2 -ScrollView2
- ScrollView1 (this is top in view hierarchy) -ScrollView1(这是视图层次结构的顶部)
The first scrollview is used to apply some transitions on the below UIView. 第一个scrollview用于在下面的UIView上应用一些转换。 The second scrollviews contentoffset (captures in scrollViewDidScroll:) is used to apply other animations.
第二个scrollviews contentoffset(scrollViewDidScroll中的捕获)用于应用其他动画。
Question: How can I transfer/delegate all touches from ScrollView1 to ScrollView2? 问题:如何将所有触摸从ScrollView1转移/委托给ScrollView2? Please note that the ScrollView1 is on top of everything and the others views are below of it - not subviews!
请注意,ScrollView1位于所有内容的顶部,其他视图位于其下方 -而非子视图!
You can add the pan gesture recogniser from a scroll view to any other view you want and this will effectively delegate the touches from the targeted view to the scroll view. 您可以将滚动视图中的平移手势识别器添加到所需的任何其他视图中,这将有效地将触摸从目标视图委派给滚动视图。 You can also add the pinch gesture recogniser if you want to control zoom.
如果要控制缩放,也可以添加捏捏手势识别器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.