2014-09-24 67 views
4

想要查看我的数学和媒体查询是否正确,因为我无法在任何地方找到此信息。iPhone 6,iPhone 6 Plus中的apple-touch-startup-image的正确大小?

<!-- iOS 8 iPhone 6 (portrait) --> 
<link rel="apple-touch-startup-image" href="/apple-touch-startup-image-750×1294.png" media="(device-width: 375px) and (device-height: 667px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)"> 
<!-- iOS 8 iPhone 6 (landscape) --> 
<link rel="apple-touch-startup-image" href="/apple-touch-startup-image-710x1334.png" media="(device-width: 375px) and (device-height: 667px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)"> 
<!-- iOS 8 iPhone 6 Plus (portrait) --> 
<link rel="apple-touch-startup-image" href="/apple-touch-startup-image-1242×2148.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)"> 
<!-- iOS 8 iPhone 6 Plus (landscape) --> 
<link rel="apple-touch-startup-image" href="/apple-touch-startup-image-1182x2208.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)"> 
+0

好吗?那么,什么是问题,你(可能)在数学和媒体查询中遇到了什么问题? – 2014-09-24 22:03:44

+0

哈哈,好吧,我想我可以更清楚。 4行代码的尺寸为750×1294,710×1334,1242×2148,1182x2208。这些是正确的吗? – 2014-09-25 02:12:42

+0

为什么每个设备的纵向和横向尺寸不同(宽度和高度的明显交换除外)? – rmaddy 2014-09-25 16:49:58

回答

9

编辑:我已经从我的文章删除不正确的信息,你已经把正确减去iPhone 6横向模式,并交换了iPhone 6+景观宽度/高度。

<!-- iPhone 6 --> 
<link href="750x1294.png" media="(device-width: 375px) and (device-height: 667px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"> 

<!-- iPhone 6+ Portrait --> 
<link href="1242x2148.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image"> 

<!-- iPhone 6+ Landscape --> 
<link href="2208x1182.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image"> 

我以前使用的启动图像搞错了尺寸相同的设备,他们根本不显示,正确的图像大小必须可以使用。

+0

[同一个mobilexweb.com链接](http://www.mobilexweb.com/blog/safari-ios8-iphone6-web-developers-designers)你来源(这是一个伟大的阅读,我已经通过它)也设备宽度为375px和414px。这与苹果触摸启动图像媒体属性一起,我已经为iPad和较旧的iPhone已经有了。 – 2014-09-27 04:11:35

+0

iPhone 6 Plus仅支持风景,我刚刚发现。这样就消除了一行代码。在发布完成的代码片段之前,仍然需要在Plus上进行测试。 – 2014-09-28 04:47:41

+0

啊,对于像素来说你绝对正确,目前有太多冲突的信息,但这似乎是最完整的。 iPhone 6+仅支持风景(不是纵向视图)还是支持纵向和横向的唯一设备? – 2014-09-29 08:32:29

0

我没有足够的信誉发表评论,所以这里是我的建议的回答,基于优秀的答案亚当·斯密:

<!-- iPhone 6 --> 
<link href="750x1294.png" media="(device-width: 375px) and (device-height: 667px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"> 

<!-- iPhone 6+ Portrait --> 
<link href="1242x2148.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image"> 

<!-- iPhone 6+ Landscape --> 
<link href="1182x2208r.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image"> 

注6 +景观形象必须由向右转90 °,尺寸必须为1182x2208。这与iPad的风景启动图像一致。如果你是一个webapp开发者并且拥有iPhone 6+,请测试这个答案和评论。谢谢!

+0

1182 x 2208旋转90°是2208 x 1182.景观图像必须保存在横向模式,它需要是2208宽和1182高。 – 2014-10-31 08:53:02

+0

@AdamSmith至少对于iPhone 5来说,启动图像必须是** always **垂直位置。 – andufo 2014-11-23 03:10:55

+0

如果有人拥有iPhone 6+可以测试正确的答案,那真是太棒了! – 2014-11-24 22:57:40