Quantcast
Channel: iPhone 6 Plus resolution confusion: Xcode or Apple's website? for development - Stack Overflow
Viewing all articles
Browse latest Browse all 9

Answer by Elvex for iPhone 6 Plus resolution confusion: Xcode or Apple's website? for development

$
0
0

For those like me who wonder how legacy apps are treated, 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.

The test was made with a simple black background bg@2x.png with a white border. The background has a size of 640x1136 pixels, and it is black with an inner white border of 1 pixel.

Below are the screenshots provided by the simulator:

On the iPhone 6 screenshot, we can see a 1 pixel margin on top and bottom of the white border, and a 2 pixel margin on the iPhone 6 plus screenshot. This gives us a used space of 1242x2204 on iPhone 6 plus, instead of 1242x2208, and 750x1332 on the iPhone 6, instead of 750x1334.

We can assume that those dead pixels are meant to respect the iPhone 5 aspect ratio:

iPhone 5               640 / 1136 = 0.5634iPhone 6 (used)        750 / 1332 = 0.5631iPhone 6 (real)        750 / 1334 = 0.5622iPhone 6 plus (used)  1242 / 2204 = 0.5635iPhone 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 enlargement of the view.

However, that scaling is not equivalent in width and height. I tried it with a 264x264 @2x resource. Given the results, I have to assume that the scaling is directly proportional to the pixels / points ratio.

Device         Width scale             Computed width   Screenshot widthiPhone 5        640 /  640 = 1.0                        264 pxiPhone 6        750 /  640 = 1.171875  309.375          309 pxiPhone 6 plus  1242 /  640 = 1.940625  512.325          512 pxDevice         Height scale            Computed height  Screenshot heightiPhone 5       1136 / 1136 = 1.0                        264 pxiPhone 6       1332 / 1136 = 1.172535  309.549          310 pxiPhone 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). 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.


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>