Possible Duplicate:
Specify images for iPad in Xcode like @2x for iPhone 4
I’m having trouble finding current conclusive information about how to properly use images based on device classes (Apple documentation being like a maze of twisted corridors, all alike). My sense is that this is something that has evolved a bit over time. Suppose I want to support non-retina and retina iphones and ipads with different images.
Here are all the permutations of filenames that I can think of:
image.png
image@2x.png
image~iphone.png
image~ipad.png
image@2x~iphone.png
image@2x~ipad.png
I could do this:
myview.xib
myview~ipad.xib
Suppose I have four devices, iPhone 3GS, iPhone 4, iPad 2, iPad 3 (or ‘new iPad’ for purists).
Let’s talk about how I would set up my xibs (i.e. I add a UIImageView, what do I choose for an image?) to use the appropriate image and how, if I use code, [UIImage imageNamed:@"image"] would behave.
It’s my understanding that in code I could fall back on UI_USER_INTERFACE_IDIOM() but I’m not convinced that I need to.
If someone could explain what will and won’t work, I know that it’ll be a help to me, and I suspect to others. If I’ve somehow duplicated another SO question I couldn’t find, well, we can close this up and link to it. Thanks!
in iphone xib you have to use image~iphone. on ipad xib you have to use image~ipad. @2x is automatic selected when file is needed.