我已将 WebView 放置在 Scrollview 中,而后者又放置在 viewcontroller 的视图中。点击 web 视图时,不会调用“tapRecognized”方法。
这是我的代码:
UITapGestureRecognizer *oneFingerTwoTaps =
[[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognized)] autorelease];
[oneFingerTwoTaps setNumberOfTapsRequired:1];
// Add the gesture to the view
[[self view] addGestureRecognizer:oneFingerTwoTaps];
我也尝试过以下方法:
[scrollview addGestureRecognizer:oneFingerTwoTaps];
[webview addGestureRecognizer:oneFingerTwoTaps];
请帮忙