0

Just wanna know, how do I must use this ?

Do I just have to set @2x after the image name ? Or to put it in a specific folder ? Or something else ?

Thanks for your advices

Rob
  • 15,732
  • 22
  • 69
  • 107

3 Answers3

3

Just after the name of the file. For example name your splash 320x480 default.png and then your 640x960 default@2x.png

ingh.am
  • 25,981
  • 43
  • 130
  • 177
2

All you need to do is add a second image into your project, named the same as the original, exactly twice as large, with @2x at the end of the file name before the extension.

Example:

some-picture.png is 20x40 pixels

some-picture@2x.png is 40x80 pixels

Anytime you use the imageNamed: method, just pass the original name, like [UIImage imageNamed:@"some-picture.png"]

Same goes when using Interface Builder.

It will automatically choose the right one at runtime.

Ben Baron
  • 14,496
  • 12
  • 55
  • 65
  • And the iOS device will select it by default if it's able to display 640x960px, right ? – Rob May 26 '12 at 21:28
1

I just answered another question along these same lines.

Apple actually describes the expected filename in detail in the "Updating Your Image Resource Files" section of this iOS Drawing reference guide.

Specifically, look for these lines in the documentation:

Standard: <ImageName><device_modifier>.<filename_extension>

High resolution: <ImageName>@2x<device_modifier>.<filename_extension>
Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215