0

I have a universal app and I have made my xibs so they can work with iPhone or iPad. However I am getting memory warnings because the UIImages are big. Is there a way to name my image files so that when running on the iPad it will use the iPad images and when on the iPhone it will use the iPhone ones?

Update: Well that was easy.

  • iPhone : image.png
  • iPhone 4 : image@2x.png
  • iPad : image~ipad.png

I wonder if this will work if I render the images on device and store them locally?

rp90
  • 854
  • 1
  • 9
  • 20

2 Answers2

0

I hope this might give you some hint

I use images with name button.png and button@2x.png and make a call using

 [UIImage imagesNamed:@"button.png"];

This loads the correct image on all device according to the resolution of the device, say iPhone3g, iPhone4 and iPad. As in the update you have taken s separate image for iPad, i really doubt that as simply the same image i.e button.png would work.

Rahul Sharma
  • 3,013
  • 1
  • 20
  • 47
  • if the device is retina display button.png returns the image button@2x.png if present. – Praveen S Jul 04 '11 at 05:10
  • The op was for iPhone to iPad. I was basically hoping for the same mechanism that you get free with the retina (@2x). And there is (~ipad). An no the same image would not work. I am displaying backgrounds and the iPhone chugs on images sized for iPad, and backgrounds on iPad look terrible with images sized for iPhone. – rp90 Jul 04 '11 at 18:31
0

Well that was easy.

  • iPhone : image.png
  • iPhone 4 : image@2x.png
  • iPad : image~ipad.png

I wonder if this will work if I render the images on device and store them locally?

rp90
  • 854
  • 1
  • 9
  • 20