What can be the iPhone 4 (retina) screen's dimensions

Malloc picture Malloc · Sep 8, 2011 · Viewed 8.5k times · Source

I have a PNG picture which I should use in my iPhone application, but first of all, I have to give it the dimensions of an iPhone 4 retina screen. Does any one know what could it be its dimensions or how to do that?

Answer

Yannick picture Yannick · Sep 8, 2011

The retina display on the iPhone 4 has the double amount of pixels than that of an older iPhone. So the complete size of an iPhone 4 screen in pixels is 640x960.

In photoshop you can quickly resize any image by changing the image size property from the Image menu. If you don't want to lose quality I suggest you start with all retina images and halve them for the non retina displays. Doing it the opposite way will decrease your quality.

If you want to use an image designed for the iPhone 4 retina display you'll want to have both pictures, one for the normal iPhone screen (320x480) and one for the retina images, in your resource's folder of your Xcode project. Use the same name for those images but append "@2x" at the end of the retina images.

So if you have a "background.png" it will become "[email protected]" and iOS will be smart enough to use the correct image for the correct type of screen.