查看移动设备 www.tekiki.com 的 html 源代码,我注意到两个问题:
这是当前源代码的片段
<!-- iPhone 3 and 4 Non-Retina -->
<link rel='apple-touch-startup-image' media='(device-width: 320px)' href='apple-touch-startup-image-320x460.png'>
<!-- iPhone 4 Retina -->
<link rel='apple-touch-startup-image' media='(device-width: 320px) and (-webkit-device-pixel-ratio: 2)' href='apple-touch-startup-image-640x920.png'>
<!-- iPhone 5 Retina -->
<link rel='apple-touch-startup-image' media='(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)' href='apple-touch-startup-image-640x1096.png'>
问题 1
对于 iPhone 4 和 iPhone 5 的链接元素,href 值不正确,需要在前面加上 '/images/dandy/'。
问题 2
device-width doesn't appear to work as it should on the iPhone 4 and iPhone 5. max-device-width should be used instead of device-width.
Test code
Here's my test html code that I got working on a iPhone 4S (I haven't tested any other iPhone models):
<!-- iPhone 3 and 4 Non-Retina -->
<link rel='apple-touch-startup-image' media='(device-width: 320px)' href='http://www.tekiki.com/images/dandy/apple-touch-startup-image-320x460.png'>
<!-- iPhone 4 Retina -->
<link rel='apple-touch-startup-image' media='(max-device-width: 480px) and (-webkit-min-device-pixel-ratio : 2)' href='http://www.tekiki.com/images/dandy/apple-touch-startup-image-640x920.png'>
<!-- iPhone 5 Retina -->
<link rel='apple-touch-startup-image' media='(max-device-width : 548px) and (-webkit-min-device-pixel-ratio : 2)' href='http://www.tekiki.com/images/dandy/apple-touch-startup-image-640x1096.png'>
An excellent blog post that you may find useful is: http://stuffandnonsense.co.uk/blog/about/home-screen-icons-and-startup-screens
Edit:
The iPhone 4S was loading the 320px loading screen instead of the 640px picture. So I have updated the html markup.