获取 UIScrollView 上的 UIResponder 实例方法。 iPhone
在我正在处理的当前项目中,在其中一个视图上,我有一个 UIView
,其顶部是由界面生成器构建的 UIScrollView
。
我已经实现了以下UIResponder
实例方法:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
但是只有当触摸事件发生在UIScrollView
未覆盖的区域时,控件才会调用此方法。
我怎样才能获得 UIScrollView
上的触摸事件?
on the current project I am working on, on one of the views, I have a UIView
and on top of it UIScrollView
which is constructed from the interface builder.
I have implemented the following UIResponder
instance methods:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
but the control comes to this methods only when touch event occur in area where is not covered by the UIScrollView
.
how I can get the hold of a touch event on the UIScrollView
also?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建 UIScrollView 的子类并覆盖:
您必须小心,不要干扰滚动手势等。
you could create a subclass of UIScrollView and override:
you have to be careful that you don't interfere with the scrolling gestures etc tho.