1. Add the local JS file and configure the properties in the head
function Increasemaxzoomfactor () {
var element = document.createelement (' meta ');
Element.name = "Viewport";
Element.content = "maximum-scale=5; width=980 ";
var head = document.getElementsByTagName (' head ') [0];
Head.appendchild (Element);
}
2. Add WebView Proxy method
Webview.scalespagetofit = YES; Self-use dimensions
WebView.scrollView.bounces = NO; Disable scrolling
3. Calling local JS code in Webviewdidfinishload
NSString *path = [[NSBundle mainbundle]pathforresource:@ "Increasezoomfactor" oftype:@ "JS"];
NSString *jscode = [NSString stringwithcontentsoffile:path encoding:nsutf8stringencoding Error:nil];
[WebView Stringbyevaluatingjavascriptfromstring:jscode];
[WebView stringbyevaluatingjavascriptfromstring:@ "Increasemaxzoomfactor ()"];
IOS JS Interactive