Iphone UIWebView无法识别Tap手势(根本不会调用方法)

Iphone UIWebView无法识别Tap手势(根本不会调用方法),iphone,ios6,uiwebview,uigesturerecognizer,Iphone,Ios6,Uiwebview,Uigesturerecognizer,当我按照在StackOverflow上找到的答案进行操作时,我所需要的UIWebView识别touch实现了以下功能: WebVC.h #import <UIKit/UIKit.h> @interface WebVC : UIViewController <UIWebViewDelegate, UIGestureRecognizerDelegate> @property (nonatomic, copy) NSString *test; @property (str

当我按照在StackOverflow上找到的答案进行操作时,我所需要的
UIWebView
识别
touch
实现了以下功能:

WebVC.h

#import <UIKit/UIKit.h>

@interface WebVC : UIViewController <UIWebViewDelegate, UIGestureRecognizerDelegate>

@property (nonatomic, copy) NSString *test;

@property (strong, nonatomic) IBOutlet UIWebView *webView;
@property (strong, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator;

@property (strong, nonatomic) UITapGestureRecognizer *tapGestureR;

- (void)handleTap:(id)sender;

@end
你知道为什么我看不到
NSLog
方法
将根本不被调用

提前谢谢你的帮助

self. webView.userInteractionEnabled = YES;
使用userInteractionEnabled方法并设置为YES。我想这对你会有帮助的

编辑:

使用WebVC.m类中的
-(BOOL)GestureRecognitor:(UIGestureRecognitor*)GestureRecognitor应与GestureRecognitor:(UIGestureRecognitor*)OtherGestureRecognitor方法同时识别

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
     NSLog(@"shouldRecognizeSimultaneouslyWithGestureRecognizer");
    return YES;
}
然后加上你的手势。
和您之前所做的一样

Nope,将这一行添加到
viewDidLoad
中,但控制台上不显示
NSLog
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
     NSLog(@"shouldRecognizeSimultaneouslyWithGestureRecognizer");
    return YES;
}
    for(UIGestureRecognizer *gesture in [webview gestureRecognizers])){
       if([gesture isKindOfClass:[UITapGestureRecognizer class]){
         if (gesture.numberOfTapsRequired == 1) 
            [webview removeGestureRecognizer:gesture];
       }
    }