Roc*_*ing 3 uiscrollview touches ios
我有一个子类UIScrollView,并覆盖所有4个Touches函数.在那些倒是功能,
[[self nextResponder] Touches...]和[super Touches...]用于通过触摸事件.
我还有一个视图控制器,我也可以覆盖所有4个Touches功能.在Controller中,我设置self.view为:self.view = subclass of UIScrollview;
在iOS 5之前,当滚动视图上有触摸移动时,视图控制器的触摸功能可以接收所有触摸开始/移动/结束/取消呼叫.但是在iOS 5中,他们不能,只收到一个touchesBegan和一个touchesMove.
从代码日志中,UIScrollView始终调用子类中的触摸函数.
此外,如果我设置了subclass.enableUserInteraction=NO,将很好地调用视图控制器中的触摸功能.但我需要scrollview与用户进行交互,所以我无法将其设置为no.
我在iOS 5中错过了什么不同的东西?先感谢您.
小智 5
有一个非常简单的工作:)
代替:
[self.nextResponder touchesMoved:touches withEvent:event];
Run Code Online (Sandbox Code Playgroud)
使用:
[[self.nextResponder nextResponder] touchesMoved:touches withEvent:event];
Run Code Online (Sandbox Code Playgroud)
也适用于touchesBegan和touchesEnded.
而已!问题消失了!现在触摸事件传递给下一个响应者:)
| 归档时间: |
|
| 查看次数: |
2838 次 |
| 最近记录: |