如果我将一个手势识别器添加到一个UIWebView
被调用的子类实例webView
,例如:
UILongPressGestureRecognizer *_longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(webViewGestureRecognized:)]; _longPressRecognizer.allowableMovement = 20; _longPressRecognizer.minimumPressDuration = 1.0f; [webView addGestureRecognizer:_longPressRecognizer]; [_longPressRecognizer release], _longPressRecognizer = nil;
在-webViewGestureRecognized:
当我执行长按选择不叫.
我已经覆盖了委托方法,-gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
但仍未调用长按选择器.
- (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; }
我可以做些什么来在网络视图上启用我自己的手势识别器吗?
据我所知,UIWebView不应该像Apple文档中提到的那样进行子类化:
http://developer.apple.com/iphone/library/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html