Content in UIWebView on iOS 3.1.3 appears zoomed on but on iOS 4.3 appears fine

雨燕双飞 提交于 2019-12-02 04:38:06

You should set scalesPageToFit of your UIWebView to YES and insert this meta tag in your html header:

<meta name='viewport' content='width=device-width; initial-scale=1.0;' />

There are plenty of parameters for CONTENT, some of them are:

maximum-scale=3.0; //Maximum zoom allowed 0 to 10.0. default is 1.6
minimum-scale=0.5; //Minimum zoom allowed 0 to 10.0. default is 0.25
user-scalable=1; //YES/NO
width=device-width; //default if not set is 980px 
initial-scale=1.0; //Initial zoom. 0 to 10.0. 1.0 would be 100%

This way your UIWebView should display your web the way you want. Hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!