Search code examples
iosuiwebviewmobile-safariviewportpinchzoom

iOS UIWebView: Disable this (zoom out) state but have zoom in enabled


I have set the following viewport tag in html file using UIWebView.

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">

Now, when user piches out, I get this effect as shown in the image. I want to disable this effect but still have the ability to zoom in.

Tried by setting UIWebView's bounce to NO, but still this problem persists.

Thanks.


Solution

  • You can do it by using bouncesZoom property of UIScrollView(property of UIWebView) as below-

    [webView.scrollView setBouncesZoom:NO];