iOS UIwebview缩放比例检测

时间:2013-04-08 04:44:31

标签: ios objective-c uiwebview

我有一个UIWebview,其中我有SWIPE右和左手势移动到UIwebview中的下一页。当webview缩放时,我不想允许SWIPE GESTURE 。我在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中添加了Gesture:

//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];

完成缩放后,GESTURE不应该发生。我该如何解决这个问题?

0 个答案:

没有答案