0

what's the best way to develop an app for the old iphone with the resolution 320x480 and for the new iphone 4 with retina display with resolution 640x960?

thanks in advance

ghiboz
  • 7,863
  • 21
  • 85
  • 131

2 Answers2

2

You can develop just as normal with Xcode and Interface Builder.
It's just advisable to provide 2 different resolutions of images - those for iPhone 2G/3G/3GS named as wanted - and the replacement for that image at the end before the suffix with @2x.

e.g.
* for iPhone 2G/3G/3GS: Default.png
* for iPhone 4: Default@2x.png

The compiler automatically takes the right one. If you do not provide an additional (or "better version") of a picture for iPhone 4, it will take the one without @2x at the end ;-).

thedom
  • 2,498
  • 20
  • 26
  • thanks thedom, but the interface builder converts automatically? and im my code if I need to move some picture, how can I check the right xy position? – ghiboz Dec 27 '10 at 08:51
  • take a look at that stackoverflow question: http://stackoverflow.com/questions/2992360/how-to-accommodate-for-the-iphone-4-screen-resolution ;-) – thedom Dec 27 '10 at 08:55
1

The sizes you specify are in interface points, not pixels. One interface point equals one pixel on the old iPhones, and equals two pixels on Retina devices. This means you can layout the interface once, with 320x480 points size.

Standard UI elements and fonts are automatically rendered in the higher resolution on Retina devices. For images, use the @2x method as described by thedom.

So there really is nothing to do for you except provide higher resolution versions of each image. Do not fall for the caveat of "I can just use double resolution images for both devices". This will result in inferior image quality on older devices (and likely a little performance loss due to the scaling).

fzwo
  • 9,842
  • 3
  • 37
  • 57