iOS Web App启动画面问题

时间:2013-06-21 00:06:35

标签: html ios

我的网站使用iOS Web App元信息时遇到了问题。我已经能够让它适用于所有设备,除了Landscape中的Retina iPad。由于我无法理解的原因,它只显示左下角的水花图像,就像它使用非Retina图像,但我不知道为什么。它适用于纵向方向。

这是我正在使用的代码:

    <!-- Do NOT use width=device width because it will letterbox viewport on iPhone 5... thanks for making it easy Apple. -->
    <meta name="viewport" content="initial-scale=1.0, user-scalable=yes">

    <!-- iPhone 4 Retina -->
    <link rel="apple-touch-startup-image" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" href="http://www.reckless-intent.com/assets/images/ios/iphone4.jpg">
    <!-- iPhone 5 Retina -->
    <link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="http://www.reckless-intent.com/assets/images/ios/iphone5.jpg">

    <!-- iPad Retina Portrait -->
    <link rel="apple-touch-startup-image" media="(device-width: 1536px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="http://www.reckless-intent.com/assets/images/ios/ipadretinaport.jpg">
    <!-- iPad Retina Landscape -->
    <link rel="apple-touch-startup-image" media="(device-width: 1536px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="http://www.reckless-intent.com/assets/images/ios/ipadretina.jpg">        

    <!-- iPad Non-Retina Portrait -->
    <link rel="apple-touch-startup-image" media="(device-width: 768px) and (orientation: portrait)" href="http://www.reckless-intent.com/assets/images/ios/ipadport.jpg">
    <!-- iPad Non-Retina Landscape -->
    <link rel="apple-touch-startup-image" media="(device-width: 768px) and (orientation: landscape)" href="http://www.reckless-intent.com/assets/images/ios/ipad.jpg">

如果您希望自己查看网站,请访问www.reckless-intent.com。我已经尝试清除缓存和cookie。我没有另外一台iPad,我可以测试它是否被隔离。

非常感谢你的时间,我真的很感激:)

Image of error on Retina iPad

1 个答案:

答案 0 :(得分:4)

正如用户Markus在上面的评论主题中所述,我的问题的解决方案是视口,应该是768px而不是1536px。

以下代码现在可以在iPhone 4,5和iPad和iPad Retina上完美运行。

    <!-- iPhone 4 Retina -->
    <link rel="apple-touch-startup-image" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" href="http://www.reckless-intent.com/assets/images/ios/iphone4.jpg">

    <!-- iPhone 5 Retina -->
    <link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="http://www.reckless-intent.com/assets/images/ios/iphone5.jpg">

    <!-- iPad (portrait) -->
    <link rel="apple-touch-startup-image" media="(device-width: 768px) and (orientation: portrait)" href="http://www.reckless-intent.com/assets/images/ios/ipad.jpg">

    <!-- iPad (landscape) -->
    <link rel="apple-touch-startup-image" media="(device-width: 768px) and (orientation: landscape)" href="http://www.reckless-intent.com/assets/images/ios/ipadport.jpg">

    <!-- iPad (Retina, portrait) -->
    <link rel="apple-touch-startup-image" media="(device-width: 768px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="http://www.reckless-intent.com/assets/images/ios/ipadretinaport.jpg">

    <!-- iPad (Retina, landscape) -->
    <link rel="apple-touch-startup-image" media="(device-width: 768px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="http://www.reckless-intent.com/assets/images/ios/ipadretina.jpg">