iOS UIwebview缩放比例检测
我有一个iOS UIwebview缩放比例检测,ios,objective-c,uiwebview,Ios,Objective C,Uiwebview,我有一个UIWebview,其中我有左右滑动的手势来移动到UIWebview中的下一页。当webview被缩放时,我不想允许滑动手势。我在ViewdidLoad中完成了此操作 webView = [[UIWebView alloc]initWithFrame:self.view.bounds]; webView.frame = CGRectMake(30, 106,966,500); webView.scrollView.bounces = NO; webView.scrollView.dele
UIWebview
,其中我有左右滑动
的手势来移动到UIWebview
中的下一页。当webview
被缩放时,我不想允许滑动手势。我在ViewdidLoad
中完成了此操作
webView = [[UIWebView alloc]initWithFrame:self.view.bounds];
webView.frame = CGRectMake(30, 106,966,500);
webView.scrollView.bounces = NO;
webView.scrollView.delegate = self;
webView.scalesPageToFit = YES;
[self.view addSubview:webView];
我还在ViewdidLoad中添加了手势:
//Swipe Gesture for Webview
swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRightAction)];
swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeftAction)];
swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
swipeRight.delegate = self;
[webView addGestureRecognizer:swipeRight];
swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft;
swipeLeft.delegate = self;
[webView addGestureRecognizer:swipeLeft];
完成缩放后,不应出现该手势。如何解决此问题?如果完成缩放,请设置“[webView RemovegestureRecognitor:swipeLeft];”和“[webView RemovegestureRecognitor:swipeRight];”我怎样才能检测到变焦被完成..请参考此感谢Ashini和Spynet。。