iPhone 4忽略了视口元标记 [英] iPhone 4 ignoring viewport meta tag
问题描述
我刚刚将以下HTML添加到我的iPhone网络应用的< head>
部分:
I have just added the following HTML to the <head>
section of my iPhone web app:
< meta name =viewportcontent =width = device-width; initial-scale = 1.0; maximum-scale = 1.0; user-scalable = no;/>
这(据说)限制了页面的缩放,因此用户无法放大。在4.0之前的iOS版本中,这个标签受到尊重 - 但是iOS版本4.0+完全忽略它,并允许您放大所需的一切。此外,如果你旋转,iPhone 4会自动奇怪地放大。
This (supposedly) limits the zoom of the page so the user can't zoom in. On iOS versions prior to 4.0, this tag is respected - but iOS versions 4.0+ completely ignore it, and lets you zoom in all you want. Furthermore, if you rotate, iPhone 4 will weirdly zoom in automatically.
所以我要问的是,我如何锁定我的应用程序的缩放?
有人能指出我正确的方向吗?
So what I'm asking is, How can I "lock" the zoom for my app? Can anyone point me in the right direction?
推荐答案
如果您在辅助功能设置中启用了缩放功能(在常规内部) ),Safari似乎忽略了视口元(仅在iOs 4上的iPhone 4上测试过)。
If you have Zoom enabled in the Accessibility settings (inside General), Safari seems to ignore the viewport meta (tested only on iPhone 4 on iOs 4).
您需要在更改设置后重新加载页面。
You need to reload your page after changing the setting.
这篇关于iPhone 4忽略了视口元标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!