I've placed the WebView inside a Scrollview, which in turn is placed inside a view of the viewcontroller. When tapping on the webview, "tapRecognized" method is not getting called.
Here's my code :
UITapGestureRecognizer *oneFingerTwoTaps =
[[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognized)] autorelease];
[oneFingerTwoTaps setNumberOfTapsRequired:1];
// Add the gesture to the view
[[self view] addGestureRecognizer:oneFingerTwoTaps];
I've also tried with the foll :
[scrollview addGestureRecognizer:oneFingerTwoTaps];
[webview addGestureRecognizer:oneFingerTwoTaps];
Please help
try adding the following statement:
//.h
...
@interface yourclass <UIGestureRecognizerDelegate>
...
//.m
...
[oneFingerTwoTaps setDelegate:self];
...
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return YES;
}
I hope it can help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With