UIWebView触摸,如果我加载了像这样的Web视图的内容
,则手势不起作用NSString* htmlPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"source.bundle/index.html"];
NSURL* url = [NSURL fileURLWithPath:htmlPath];
NSLog(@"the urll==%@",url);
NSURLRequest* request = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:request];
UIPanGestureRecognizer *recognizer =[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panDetected:)];
[self.webView addGestureRecognizer:recognizer];
答案 0 :(得分:0)
嗨,你可以试试这个,
UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc]
initWithTarget:self action:@selector(panSubview:)];
[subview addGestureRecognizer:panRecognizer];
// play nice with subview's pan gesture
[YourView.panGestureRecognizer
requireGestureRecognizerToFail:panRecognizer];
由于