我已经创建了一个网页视图以显示PDF,现在使用的手势识别单抽头我必须调用一些方法,但单抽头不能识别手势识别器在iPhone应用程序
我已经使用这个代码
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 450,450)];
UITapGestureRecognizer *DoubleFingerDTap = [[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(screenTappedtwice:)];
DoubleFingerDTap.numberOfTapsRequired = 1;
[webView addGestureRecognizer:DoubleFingerDTap];
[DoubleFingerDTap release];
方法称为
- (void)screenTappedtwice:(UIGestureRecognizer *)sender {
CGPoint tapPoint = [sender locationInView:sender.view.superview];
[UIView beginAnimations:nil context:NULL];
sender.view.center = tapPoint;
//Check the current state of the navigation bar...
//BOOL navBarState = [self.navigationController isNavigationBarHidden];
// Set the navigationBarHidden to the opposite of the current state.
// [self.navigationController setNavigationBarHidden:TRUE animated:YES];
[self.navigationController setNavigationBarHidden:YES animated:YES];
[UIView commitAnimations];
}
类似这样的问题:http://stackoverflow.com/questions/2909807/does-uigesturerecognizer-work-on -a-uiwebview – Stuart
i dint从上面的链接获得所需的答案, – Ravi