Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New image name for iPhone 5

Tags:

xcode

iphone

ios6

With the retina we make images with the @2x in the name. I see where the default image has to be default-568h@2x but this does not seem to be the case for other images. Like if my background is bg.png and [email protected] I tried using [email protected] but that does not work. Can somebody tell me what the images need to be named to support the iPhone 5?

like image 210
mmoore410 Avatar asked Sep 19 '12 15:09

mmoore410


People also ask

How do I change the name of a picture on my iPhone?

Go to Photos and open a picture. Tap on Share, scroll down and tap “Save to Files”. Tap “On My iPhone” and select a folder. To rename the image, tap the file name next to the image thumbnail and enter a name.

How do I find the name of my iPhone?

Go to Settings > General > About > Name.


2 Answers

No special suffix for iPhone 5 (4'' display), just the specific [email protected] file.

Here's a macro to handle it:

// iPhone 5 support #define ASSET_BY_SCREEN_HEIGHT(regular, longScreen) (([[UIScreen mainScreen] bounds].size.height <= 480.0) ? regular : longScreen) 

Usage: (assets names - image.png, [email protected], [email protected])

myImage = [UIImage imageNamed:ASSET_BY_SCREEN_HEIGHT(@"image",@"image-568h")]; 
like image 150
Avishay Cohen Avatar answered Sep 18 '22 03:09

Avishay Cohen


There is no specific image name. Having the Default-568h@2x will launch that image on an iPhone 5 or iPod Touch 5G and will enable the non-letterbox mode. After that, you need to design your views to be flexible. There is no special "image name" or anything for the new size.

For your background, for example, you should probably be using an image that is capable of stretching or tiling and have it configured properly before setting it.

like image 30
Jason Coco Avatar answered Sep 21 '22 03:09

Jason Coco