UIWebView — load external website, programmatically set initial zoom scale, and allow user to zoom afterwards

前端 未结 5 1165
忘了有多久
忘了有多久 2020-12-02 23:58

Is it possible to do all of the above? SO has given me a great way to set the initial zoom scale here. Namely, to include the following line in my webViewDidFinishLoad met

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 00:34

    Try changing the order that you are setting these commands - first scalePagesToFit to YES and then:

    [webView stringByEvaluatingJavaScriptFromString: @"document.body.style.zoom = 5.0;"];
    

提交回复
热议问题