Search code examples
objective-cuiwebview

iOS Webview Zoom Level


How can I find the zoom level of webview's scrollView programmatically. I tried with below code.

My code:

[WebView stringByEvaluatingJavaScriptFromString:[Nssting stringWithFormat:@"document.body.style.zoom = %f;",zoomlevel]; 

Solution

  • Finally I got the answer.

    May be it will help anyone.

    Here is my answer:

    add this meta tag in your html string.

    meta name='viewport' content='width=300,minimum-scale=0.25,maximum-scale=3.0,user-scalable=yes'

    Thanks, AKS