15

Possible Duplicate:
How to accommodate for the iPhone 4 screen resolution?

What is the best way to include Retina Display Images on an iPhone app. Are there issues with the iPhone 3G or older iPhone with higher res images?

Community
  • 1
  • 1
Daniel Kivatinos
  • 24,088
  • 23
  • 61
  • 81
  • possible duplicate of [How to accommodate for the iPhone 4 screen resolution?](http://stackoverflow.com/questions/2992360/how-to-accommodate-for-the-iphone-4-screen-resolution). Also review the [retinadisplay](http://stackoverflow.com/questions/tagged/retinadisplay) tag. – Michael Petrotta Jan 26 '11 at 00:49
  • @MichaelPetrotta not a duplicate; the linked question isn't about images specifically, and nobody has provided an answer there that explains how to use retina images. (Well, okay, there once was one but it was self-censored over NDA concerns and then deleted.) This ought to be reopened. – Mark Amery Dec 11 '15 at 10:24
  • Follow "https://stackoverflow.com/questions/48483934/how-to-handle-iphone-screen-sizes-resolution-for-background-images/48563225#48563225" – Rishil Patel Mar 16 '18 at 15:55

1 Answers1

52

Include a hi-res version of your image named as "image@2x.png" (where "image.png" is the normal resolution). When you access your image using [UIImage imageNamed:@"image.png"], the correct one will be chosen automatically. Devices without retina display won't load the hi-res version, so there's no memory overhead.

omz
  • 53,243
  • 5
  • 129
  • 141