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

后端 未结 1 1247
日久生厌
日久生厌 2021-01-24 07:13

I am running into a difference in UIWebView behaviour on two different devices I am testing. First here is the listing of devices I am testing with...

Device #

相关标签:
1条回答
  • 2021-01-24 08:10

    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!

    0 讨论(0)
提交回复
热议问题