how to set apple-touch-startup-image for iphone5?

断了今生、忘了曾经 提交于 2019-11-29 00:10:01

问题


I tried

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

But it didn't work. And apple's interface guildline hasn't been updated for iphone5.

Anybody knows?Thanks!


回答1:


1.Don't use "width=device-width" for viewport, use codes below:

<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.Prepare an image sized 640*1096, save as "Images/Default-568h@2x", add this code to your page's header:

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

Here's a demo, it's compatible with iPhone5: https://github.com/openfibers/php-tot




回答2:


The startup image has no direct relationship with the letterboxing.

The solution is to just change the viewport to a different width than device-width or 320. Why? I don't know, it's really weird but if you just use the next viewport you don't get the letterbox.

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

The sizes attribute on the apple-touch-startup-image is being ignored so if you want to provide more than one you need to use media queries.

Other solution is to just update the viewport using JavaScript when it's an iPhone/iPod 4".

More on the solution and the findings at http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers#updatewebapps




回答3:


There is an official reference for this… (even for iPhone 5)

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



来源:https://stackoverflow.com/questions/12454208/how-to-set-apple-touch-startup-image-for-iphone5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!