简体   繁体   English

我的应用目前在iPhone 6 / iPhone 6 plus上的表现如何?

[英]How does my app currently behaves on an iPhone 6 / iPhone 6 plus?

I got the following numbers for iPhone devices, from PaintCodeApp website 我从PaintCodeApp网站获得了以下iPhone设备号码

Device          Zoom display  Points   Rendered pixels Scale
                              W   H    W    H          
iPhone 6 Plus   Off           414 736  1242 2208       @3x
iPhone 6 Plus   On            375 667  1125 2001       @3x
iPhone 6        Off           375 667   750 1334       @2x
iPhone 6        On            320 568   640 1136       @2x
iPhone 5        -             320 568   640 1136       @2x
iPhone 4        -             320 480   640  960       @2x
iPhone 3GS      -             320 480   320  480       @1x

Since my apps were designed for iPhone 3GS up to iPhone 5, the supported points frames are 320x480@1x, 320x480@2x and 320x568@2x. 由于我的应用程序专为iPhone 3GS设计,最高支持iPhone 5,因此支持的点数框架为320x480 @ 1x,320x480 @ 2x和320x568 @ 2x。

I assume that on an iPhone 6 with the zoom mode enabled, the display should be the exact same as the iPhone 5, since the points frame is 320x568@2x as well. 我假设在启用了缩放模式的iPhone 6上,显示器应该与iPhone 5 完全相同 ,因为点框架也是320x568 @ 2x。 This might be wrong, since I cannot find no confirmation. 这可能是错的,因为我找不到任何确认。

Now, what I'm really wondering is how my apps shows on iPhone 6 with the zoom mode off, and on iPhone 6 plus with or without the zoom mode, since the points frames are 375x667@2x, 375x667@3x and 414x736@3x. 现在,我真正想知道的是我的应用程序如何在关闭缩放模式的情况下显示在iPhone 6上,以及在带有或不带缩放模式的iPhone 6上显示,因为点数帧为375x667 @ 2x,375x667 @ 3x和414x736 @ 3x 。

Apple Developer Support couldn't give me no hint nor documentation to read on the subject. Apple Developer Support无法向我提供有关此主题的提示或文档。 Since I haven't bought the new devices, is there anyone who knows what actually happens with old apps ? 由于我还没有购买新设备,有没有人知道旧应用程序究竟发生了什么?

For those like me who wonder how are treated legacy apps, I did a bit of testing and computation on the subject. 对于那些想知道如何处理遗留应用程序的人,我对这个主题进行了一些测试和计算。

Thanks to @hannes-sverrisson hint, I started on the assumption that a legacy app is treated with a 320x568 view in iPhone 6 and iPhone 6 plus. 感谢@ hannes-sverrisson提示,我开始假设在iPhone 6和iPhone 6 plus中使用320x568视图处理遗留应用程序。

The test was made with a simple black background bg@2x.png with a white border. 测试是用简单的黑色背景bg@2x.png ,带有白色边框。 The background has a size of 640x1136 pixels, it is black with an inner white border of 1px. 背景的大小为640x1136像素,黑色,内部白色边框为1px。

Below are the screenshots provided by the simulator : 以下是模拟器提供的屏幕截图:

What we can see on the iPhone 6 screenshot is a 1px margin on top and bottom of the white border, and a 2px margin on the iPhone 6 plus screenshot. 我们在iPhone 6屏幕截图上看到的是白色边框顶部和底部的1px边距,以及iPhone 6 plus屏幕截图的2px边距。 This gives us a used space of 1242x2204 on iPhone 6 plus, instead of 1242x2208, and 750x1332 on the iPhone 6, instead of 750x1334. 这给我们在iPhone 6 plus上使用了1242x2204的空间,而不是iPhone 6上的1242x2208和750x1332,而不是750x1334。

We can assume that those dead pixels are meant to respect the iPhone 5 aspect ratio : 我们可以假设这些坏点是为了尊重iPhone 5的宽高比:

iPhone 5               640 / 1136 = 0.5634
iPhone 6 (used)        750 / 1332 = 0.5631
iPhone 6 (real)        750 / 1334 = 0.5622
iPhone 6 plus (used)  1242 / 2204 = 0.5635
iPhone 6 plus (real)  1242 / 2208 = 0.5625

Second, it is important to know that @2x resources will be scaled not only on iPhone 6 plus (which expects @3x assets), but also on iPhone 6. This is probably because not scaling the resources would have led to unexpected layouts, due to the enlargment of the view. 其次,重要的是要知道@ 2x资源不仅会在iPhone 6 plus(需要@ 3x资产)上扩展,而且还会在iPhone 6上扩展。这可能是因为没有扩展资源会导致意外布局,扩大视野。

However, that scaling is not equivalent in width and height. 但是,该缩放在宽度和高度上不相等。 I tried it with a 264x264 @2x resource. 我尝试使用264x264 @ 2x资源。 Given the results, I have to assume that the scaling is directly proportionnal to the pixels / points ratio. 鉴于结果,我必须假设缩放与像素/点比率直接成比例。

Device         Width scale             Computed width   Screenshot width
iPhone 5        640 /  640 = 1.0                        264 px
iPhone 6        750 /  640 = 1.171875  309.375          309 px
iPhone 6 plus  1242 /  640 = 1.940625  512.325          512 px

Device         Height scale            Computed height  Screenshot height
iPhone 5       1136 / 1136 = 1.0                        264 px
iPhone 6       1332 / 1136 = 1.172535  309.549          310 px
iPhone 6 plus  2204 / 1136 = 1.940141  512.197          512 px

It's important to note the iPhone 6 scaling is not the same in width and height (309x310). 重要的是要注意iPhone 6的缩放在宽度和高度上不一样的 (309x310)。 This tends to confirm the above theory that scaling is not proportional in width and height, but uses the pixels / points ratio. 这倾向于证实上述理论,即缩放在宽度和高度上不成比例,但使用像素/点比率。

I hope this helps. 我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM