如何为 iPhone5 设置 Apple-touch-startup-image



我试过

<link href="Images/Default-568h@2x.png" sizes="640x1136" media="(device-width: 640px) and (device-height: 1136px)" rel="apple-touch-startup-image">

但它没有用。苹果的界面公会线尚未针对iphone5进行更新。

有人知道吗?谢谢!

1.不要将"宽度=设备宽度"用于视口,请使用以下代码:

<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">

2.准备一张尺寸为640*1096的图片,另存为"图片/默认568h@2x",将以下代码添加到页面标题中:

<link href="Images/Default-568h@2x.png" rel="apple-touch-startup-image" sizes="640x1096">

这是一个演示,它与iPhone5兼容:https://github.com/openfibers/php-tot

启动映像与上下黑边没有直接关系。

解决方案是将视口更改为与设备宽度或 320 不同的宽度。为什么?我不知道,这真的很奇怪,但如果你只使用下一个视口,你不会得到信箱。

<meta name="viewport" content="width=320.1">

苹果触摸启动映像上的 size 属性被忽略,因此如果要提供多个属性,则需要使用媒体查询。

另一种解决方案是当它是iPhone/iPod 4"时,使用JavaScript更新视口。

有关解决方案和发现的更多信息,请访问 http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers#updatewebapps

对此有

官方参考...(即使是iPhone 5)

http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html

最新更新