Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Universal application iPad/iPhone image naming convention?

In my application I need to get the correct image based on the device iPad/iPhone 4/iPhone 3 device.

For example:

I have an image named a.png (width 40,height 20) for iPhone 3/iPod, and [email protected] (width 80,height 40) for iPhone 4.

If I mentioned the code

UIImage *myImage=[UIImage imageNamed:@"a.png"];

myImage contains (80*40) image if it's iPhone 4. myImage contains (40*20) image if it's iPod/iPhone 3.

My question is how do I get the image for iPad (60*30) like above naming convention.

I tried giving a~ipad.png as an image name and it's not working. Can you point out where there is a mistake?

And if I use the condition using [UIDevice currentDevice]; isIpod -> load(60*30) image otherwise load images for iPhone/iPod it's working fine.

But I need to get it to work without using the condition, and using the naming convention like a.png for iPhone/iPod, [email protected] for iPhone 4 and likewise for iPad.

Thanks in advance.

like image 798
mac Avatar asked Oct 28 '10 07:10

mac


1 Answers

I know it is old post, but I think Screenshot gives more clear idea about naming convention.

enter image description here

With latest devices: button@3x~iphone.png and button@3x~ipad.png

like image 75
brianLikeApple Avatar answered Nov 15 '22 18:11

brianLikeApple