1

if I have a universal app with 4 images as below

  • iPhoneimage.png (50x50)
  • iPhoneimage@2x.png (100x100)
  • iPadimage.png (100x100)
  • iPadimage@2x.png (200x200)

They are all the same image, just different sizes. As you can see the iPhone retina image is the same size as the iPad non-retina image.

Is there a way to use the iPhone retina image as the iPad non-retina image without duplicating the file itself and renaming it? Just seems a bit of a waste of memory, especially if it occurs often in the application.

EagerMike
  • 2,032
  • 1
  • 24
  • 40

3 Answers3

4

I am doing the same thing in an application of my own. I found that naming the images image.png, image@2x.png, and image@2x@2x.png worked quite well.

j0k
  • 22,600
  • 28
  • 79
  • 90
Allison
  • 41
  • 2
1

You can just name it iPhoneimage.png and set the size to 200x200, but you need to manage the image scaling accordingly.

But note that you'll gain some SSD memory and maybe you can stay below the 50MB limit for 3G App Store download, but you'll consume much more ram memory.

MacTeo
  • 2,656
  • 1
  • 20
  • 23
  • You mean name a 200x200 image `iPhoneimage.png` and set the size to 50x50 or 100x100 if needed? – Wienke May 02 '12 at 14:46
  • 1
    Exactly, or use `UIImageView`'s `contentMode` and the `UIViewContentModeScaleAspectFit` option. – MacTeo May 02 '12 at 15:26
0

i did not try but it got thumbs up 13 times so should be right .. :)

iphone&ipad retina image processes

hope this helps to you..

Community
  • 1
  • 1
iremk
  • 677
  • 1
  • 5
  • 16
  • That method doesn't solve the required images, just replaces the needs to write the lines to call different image names. – MacTeo May 02 '12 at 13:03
  • it seems it solves because , it just figures out if the image to be loaded to ipad or iphone-retina , so if ipad uses the image as it is if not it just returns the same image by adding @2x to the image name.. but i'm not sure if this is right cuz i did not try but logically it seems to fit.. hope this helps.. – iremk May 02 '12 at 13:37