iOS 3.1.3 上 UIWebView 中的内容显示为放大,但在 iOS 4.3 上显示正常
我在测试的两个不同设备上遇到了 UIWebView 行为的差异。首先是我正在测试的设备列表...
设备#1 -> iPod 2G / iOS 3.1.3
设备#2 -> iPhone 4 / iOS 4.3
我在两台设备上加载相同的 HTML 内容,但在 iPod 上加载时,内容显示为放大的。在 iPhone 上,内容显示正确。据我所知,我认为这可能与视网膜显示屏有关,也许 iPhone 本身就可以接受更大分辨率的内容,但目前我还没有得到证实。想知道以前是否有人遇到过这种行为。
感谢任何和所有的帮助。
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 -> iPod 2G / iOS 3.1.3
Device #2 -> iPhone 4 / iOS 4.3
I have the same HTML content being loaded on both devices but when it's loaded on the iPod the content appears zoomed in. On the iPhone the content appears correctly. From what I know I think this may have to do with retina display and perhaps the iPhone can natively accept content at a larger resolution but I have nothing confirmed at the moment. Wondering if anyone has encountered this type of behaviour before.
Any and all help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该将 UIWebView 的 scalesPageToFit 设置为 YES 并在 html 标头中插入此元标记:
CONTENT 有很多参数,其中一些是:
这样您的 UIWebView 应该按照您想要的方式显示您的网页。
希望这有帮助!
You should set scalesPageToFit of your UIWebView to YES and insert this meta tag in your html header:
There are plenty of parameters for CONTENT, some of them are:
This way your UIWebView should display your web the way you want.
Hope this helps!