views:

124

answers:

5

I am planning an app for iphone 3g, 3gs and iphone 4. I have a 57*57 image for 3g and 3gs. When I checked documentation apple suggests us to use a 114*114 image for iphone 4. So how can I support both the images with the same build.

+6  A: 

Call the iPhone 4 icon [email protected]

http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html

nevan
+1  A: 

You have to list all your icons in your Application's plist, and name the ones for iPhone 4 "[email protected]" (add '@2x' to your file's name).

jv42
Thanks jv42 . You saved my time. :)
Krishnan
+1  A: 

If you place the original icon and an icon with the same name but add @2x to the end of the name in your resources folder the correct one will be used automaticly.

Dan
+7  A: 

Use the CFBundleIconFiles property in your Info.plist and supply two icons, you name the high-resolution one with an "@2x" suffix so the iOS knows it's the high-resolution icon to use on iPhone 4. You can also specify iPad icons (for apps that run on iPhone and iPad) using the same property. This is documented here: http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BuildTimeConfiguration/BuildTimeConfiguration.html

jhabbott
+1 for most complete answer.
jv42
My understanding is that the "@2x" suffix _only_ works if you do not specify the icon extension in your plist, i.e. ".png".
Harkonian
You can specify the suffix if you want, but if you do then you need to specify each icon explicitly. From the apple docs (linked in my answer): "When specifying icon files using the CFBundleIconFiles key, it is best to omit the filename extensions of your image files. If you include a filename extension, you must explicitly add all of your image files (including any high-resolution variants) to the array. When you omit the filename extension, the system automatically detects high-resolution variants of your file using the base filename you provide."
jhabbott
+1  A: 

The collection of different possible icon sizes for iOS is getting pretty long now. But all you need to do is to list all of the files in your app's Info.plist in the CFBundleIconFiles key, and the OS will do the work of picking the correct size.

Sixten Otto