gpt4 book ai didi

ios - 过渡到 iOS 7 : correct viewport setting for jQuery/iPhone Webapps viewed on iPads

转载 作者:IT王子 更新时间:2023-10-29 07:56:14 24 4
gpt4 key购买 nike

我们有一个基本上有一个 UIWebView 的应用程序,它在 XCode 中设置为“iPhone App”。

到目前为止一切正常,但使用 iOS 7 iPad 模拟器,应用程序现在立即出现在“全屏”中,这不是问题,但 WebView 似乎也被放大了。

我只看到已加载网站的右上 1/4,必须滚动才能看到其余部分。

我们在应用程序中使用 jQuery Mobile 1.3.1。

编辑

我发现了错误。视口(viewport)元元素的语义似乎在 iOS 版本之间发生了变化。

改变

<meta name="viewport" content="width=device-width, initial-scale=1">

<meta name="viewport" content="initial-scale=1">

为我工作,但我不确定这是否是自 jQuery Mobile Demo 以来的方式Page 确实将 with 设置为 device-with。当我从我的 UIWebView 加载演示页面时,我得到了同样的效果。

是否有关于设置视口(viewport)的“正确方法”的任何信息,特别是因为演示页面使用 width=device-width

最佳答案

在 iOS 7 上,它已经改变了解释 vieport 元标记的方式。在这里你可以找到解释https://developer.apple.com/library/ios/releasenotes/General/RN-iOSSDK-7.0/#//apple_ref/doc/uid/TP40013202-CH1-SW75 .

Previously, when the viewport parameters were modified, the old parameters were never discarded. This caused the viewport parameters to be additive.

For example, if you started with width=device-width and then changed it to initial-scale=1.0, you ended up with a computed viewport of width=device-width, initial-scale=1.0.

In iOS 7, this has been addressed. Now you end up with with a computed viewport of initial-scale=1.0.

现在的问题是:这将如何影响 iOS6< 和 Android 设备上的布局?

关于ios - 过渡到 iOS 7 : correct viewport setting for jQuery/iPhone Webapps viewed on iPads,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18892491/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com