1

当有人从 iPhone 加载我们的应用程序时,我们使用以下元标记来显示加载屏幕,但是当我们点击主屏幕图标时,只会出现一个白页。我们还需要做什么来启用加载屏幕?

该网站是www.tekiki.com

<link rel='apple-touch-icon-precomposed' href='/images/dandy/dandy_57.png' />
<link rel='apple-touch-startup-image' media='(device-width: 480px)' href='/images/dandy/loading_screen.png'>    
<link rel='apple-touch-startup-image' media='(device-height: 568px)' href='/images/dandy/loading_screen_iphone5.png'>
4

2 回答 2

0

我猜你还没有指定正确的尺寸。

您可以在这篇文章中找到已在 SO 上发布的标签列表

我不能测试这个正确的知道,但你可能只是谷歌apple-touch-startup-image找到像这样有用的帖子,可能需要结合其中的一些。

这看起来像是一个完整且非常新鲜的集合(来自http://www.miguelmota.com/blog/iphone-and-ipad-web-app-startup-images/

<!--iPhone and iPad Web App Startup Images -->

<!-- Do NOT use width=device width because it will letterbox viewport. -->
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<!-- 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">

<!-- iPad Non-Retina Portrait -->
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (orientation: portrait)" href="apple-touch-startup-image-768x1004.png">
<!-- iPad Non-Retina Landscape -->
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (orientation: landscape)" href="apple-touch-startup-image-748x1024.png">
<!-- iPad Retina Portrait -->
<link rel="apple-touch-startup-image" media="(device-width: 1536px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="apple-touch-startup-image-1536x2008.png">
<!-- iPad Retina Landscape -->
<link rel="apple-touch-startup-image" media="(device-width: 1536px)  and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="apple-touch-startup-image-2048x1496.png">`
于 2013-07-24T23:46:13.293 回答
0

查看移动设备 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.

于 2013-07-29T16:59:12.593 回答