1. Add local js file , And configuration head Properties in

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 to webview Proxy method

webView.scalesPageToFit = YES; // Self use size
webView.scrollView.bounces = NO; // Disable scrolling

3. stay webViewDidFinishLoad Call local js Code

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 More articles about interaction

  1. iOS JS Interactive utilization system JSContext Realization JS call OC Methods and Objective-C call JavaScript Method

    ios js Interaction is divided into two parts : 1.oc call js This one is relatively simple to implement , What's loaded in my project is local html,js,css, Note that when you drag these files into the project , Select Copy to project ,( The folder you drag in is blue ...

  2. iOS JS Interactive utilization system JSContext Realization JS call oc Method

    ios js Interaction is divided into two parts : 1.oc call js This one is relatively simple to implement , What's loaded in my project is local html,js,css, Note that when you drag these files into the project , Select the following operation ,( The folder you drag in is blue , ...

  3. Li Hongqiang iOS Classic interview questions 147-WebView And JS Interaction

    Li Hongqiang iOS Classic interview questions 147-WebView And JS Interaction   WebView And JS Interaction iOS Call in HTML 1. Load web page NSURL *url = [[NSBundle mainBundle] UR ...

  4. iOS(WKWebView)OC And JS Interaction A third

    With H5 It's getting more powerful , Guys who haven't done mixed development are embarrassed to say that they can do it independently iOS Of app Development , stay iOS7 Under the operating system , frequently-used native,js The interaction framework has easy-js,WebViewJavascr ...

  5. iOS(UIWebView and WKWebView)OC And JS Interaction The second

    stay iOS In the process of application development , We often use WebView, When we are right WebView When operating , Sometimes you need to do the original operation . So I'll write it down and share it with you OC And JS Interaction . First of all, the first method , It's not about O ...

  6. iOS Under the original and JS Interaction ( summary )

    iOS Development has to do with UIWebView Dealing with , And then it comes to JS With native OC Interaction , Let's summarize today JS With native OC Two ways to interact . JS Call native OC piece ( My own way is two , Easy and convenient ) Mode one The first way is to use JS ...

  7. Ios Development of -- js and ios Interaction

    ==WebViewJavascriptBridge Introduction to == # download :https://github.com/marcuswestin/WebViewJavascriptBridge # About WebVie ...

  8. iOS And JS Interactive combat (ObjC edition )

    Preface ObjectiveC And Js Interaction is a common requirement , But for novices or so-called masters , It's not that simple . This is just an introduction iOS7.0 After that JavaScriptCore framework. About JavaS ...

  9. iOS webView And js Interactively enter text on the text space

    Project requirement :webview load html website , The content is the text of filling in the blanks , You need to add answers on the line , And click the submit button to echo the answer Normal loading effect picture : This is for js The rendering after interaction : Click on the space , Enter the answer you want to enter , Such as ...

Random recommendation

  1. python in enumerate Use

    stay python The application of , When we use an array or list, we need to traverse both the index and the elements. The usual way is like this : >>> lsi = [1,2,3,4,5,6,7,8,9] >> ...

  2. [PHP] find ascii code in string

    if (strpos($data ,chr(0x95)) !== false) { echo 'true'; }else{ echo "false"; }

  3. tinkphp URL rewrite , Support pseudo static

    Usual URL It contains index.php, In order to achieve better SEO The effect may need to be removed URL Inside index.php , adopt URL Rewriting can achieve this effect , Usually the server needs to be turned on URL_REWRITE Module to support ...

  4. STL Source code analysis Algorithm stl_algo.h -- equal_range

    This paper is about senlie original , Please keep this address for reprint :http://blog.csdn.net/zhengsenlie equal_range( Applied to ordered intervals ) ------------------------- ...

  5. sql server2012 Additional database issues

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMjM2NzUxMw==/font/5a6L5L2T/fontsize/400/fill/I0JBQk ...

  6. spring boot introduction ( One ) Build it yourself spring boot

    spring boot Official documents   http://docs.spring.io/spring-boot/docs/1.2.3.RELEASE/reference/html/index.html This article ...

  7. centOS6.4 install python3.5, And install pip

    Preface : If you use it too centos System , I'm going to pack python3.0 Above version , Put it on again python Download tool pip, So congratulations , You may have all kinds of problems like me ! Another very important point :centos They all bring their own p ...

  8. Python:Day46 Javascript DOM

    history object : History Object contains user ( In the browser window ) Visited URL. Windows are independent of each other . <input type="button" onclick=&qu ...

  9. linux Lower installation nginx And preliminary understanding

    linux Lower installation configuration nginx nginx: Is a high performance reverse proxy server, forward proxy is the client , The reverse proxy agent is the server . Here we use nginx-1.12.2 Version as an example 1. First go to the official website to download nginx-1.1 ...

  10. flask,gunicorn,supervisor,nginx Configure the server interface

    1, Apply for Alibaba cloud host 2,apt-get update 3,apt-get install pip 4,pip install virtualenv 5,virtualenv venv 6,source ...