1

I am using three versions of image:

  1. abc.png
  2. abc@2x.png
  3. abc@3x.png

I just want to know that if I use abc.png wherever this image is used, does all the versions are automatically picked according to iPhone resolution or I have to make an image asset for this.

I did a Google search but nothing satisfactory found.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
ankit
  • 3,537
  • 1
  • 16
  • 32
  • Assuming you are talking about `UIImage imageNamed`, just pass `@"abc"` as the name. – rmaddy Sep 09 '15 at 05:38
  • BTW - read the docs for `UIImage imageNamed:`. – rmaddy Sep 09 '15 at 05:39
  • you need to set only abc.png, all other size of image will automatically picked according to resolution – Bhanu Sep 09 '15 at 05:40
  • possible duplicate of [Xcode 6 - xcassets for universal image support](http://stackoverflow.com/questions/26020979/xcode-6-xcassets-for-universal-image-support) – Anbu.Karthik Sep 09 '15 at 05:41

2 Answers2

2

When we use any image in your app it pick the image according to the device resolution which set constraint by the APPle Inc. The Asset is listed below for more clarity:

  1. iPad 2 and iPad mini (@1x)
  2. iPad (Air) and iPad mini (Retina) (@2x)
  3. iPhone 4s (@2x)
  4. iPhone 6 and iPhone 5 (@2x)
  5. iPhone 6 Plus (@3x)

For all images and icons, the PNG format is recommended. You should avoid using interlaced PNGs. I wish it'll help you.Let me know if further more concern.

Anand Prakash
  • 313
  • 5
  • 20
0

only write @"abc". it selects the desired image automatically

Darshan Karekar
  • 681
  • 3
  • 16