UIScrollview + UItextview触摸事件

时间:2010-01-20 06:09:48

标签: iphone cocoa-touch uiscrollview

我正在使用滚动视图和滚动视图我有UIIMageview和UITextview.My问题是-i想要Touchevent of Textview。

1 个答案:

答案 0 :(得分:0)

我认为UIScrollView成为触摸事件的第一个响应者,并且它不会将触摸事件作为默认值传递给其他视图。
那么,为什么不创建UIScrollView的子类?然后,将子类接收的所有触摸事件传递给UIIMageview或UITextview,如下所示。

@implementation SubclassOfScrollView
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [self.nextResponder touchesBegan:touches withEvent:event];
}
@end