Reputation: 8003
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
Upvotes: 0
Views: 477
Reputation: 9902
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).
Upvotes: 1
Reputation: 2518
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: [email protected]
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 ;-).
Upvotes: 2