iPhone 6 Plus分辨率混乱:Xcode还是Apple的网站?发展 [英] iPhone 6 Plus resolution confusion: Xcode or Apple's website? for development

查看:88
本文介绍了iPhone 6 Plus分辨率混乱:Xcode还是Apple的网站?发展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple的网站声称分辨率为1080p:1920 x 1080



然而,Xcode(今天推出的8.0 GM)所需的启动画面为2208 x 1242。 / p>

谁是对的?



解决方案

iPhone 6+内部使用 @ 3x 进行渲染虚拟分辨率为 2208×1242 736x414 点)的资产,然后向下采样以进行显示。与在Retina MacBook上使用缩放分辨率相同 - 它可以让它们达到像素资产的整数倍,同时仍具有12  pt文本在屏幕上看起来大小相同。



所以,是的,启动屏幕必须是那么大。



数学:



6,5s,5,4和4都是每英寸326像素,使用@ 2x资产来坚持以前所有设备每英寸约160点。



6+是每英寸401像素。所以它假设需要大约2.46倍的资产。相反,Apple使用@ 3x资产并将完整输出降低到其自然尺寸的84%左右。



在实践中,Apple决定更多地使用87%,转向将1080改为1242.毫无疑问,要找到尽可能接近84%的东西仍能在两个方向上产生整体尺寸 - 1242/1080 = 2208/1920正好相反,而如果你将1080转为1286 ,你需要在某种程度上垂直渲染2286.22像素才能很好地扩展。


Apple's website claims that the resolution is 1080p: 1920 x 1080

However, the launch screen required by Xcode (8.0 GM launched today) is 2208 x 1242.

Who's right?

解决方案

The iPhone 6+ renders internally using @3x assets at a virtual resolution of 2208×1242 (with 736x414 points), then samples that down for display. The same as using a scaled resolution on a Retina MacBook — it lets them hit an integral multiple for pixel assets while still having e.g. 12 pt text look the same size on the screen.

So, yes, the launch screens need to be that size.

The maths:

The 6, the 5s, the 5, the 4s and the 4 are all 326 pixels per inch, and use @2x assets to stick to the approximately 160 points per inch of all previous devices.

The 6+ is 401 pixels per inch. So it'd hypothetically need roughly @2.46x assets. Instead Apple uses @3x assets and scales the complete output down to about 84% of its natural size.

In practice Apple has decided to go with more like 87%, turning the 1080 into 1242. No doubt that was to find something as close as possible to 84% that still produced integral sizes in both directions — 1242/1080 = 2208/1920 exactly, whereas if you'd turned the 1080 into, say, 1286, you'd somehow need to render 2286.22 pixels vertically to scale well.

这篇关于iPhone 6 Plus分辨率混乱:Xcode还是Apple的网站?发展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆