On my work, technology and related stuff....

6 comments

If you have an iPhone app or are developing one, with the launch of iPhone5 , you  need to ensure that your images scale to support the new taller retina display (640X1136).

In case of the launch image, naming the new launch with the suffix "-568h@2x" (e.g.. Default-568h@2x) will ensure that the system picks up the right launch image for the iPhone5.

However, just adding the "-568h@2x" to the new images is not sufficient to have the system pick the right images for the tall retina display. Here is a very simple category on UIImage that can be used to return the right image. Note that in the category implementation, I assume that all the iPhone5 specific images are named with a suffix of "-568h@2x".

 

The "UIImage+iPhone5extension.h" Interface definition

 

 

 

The "UIImage+iPhone5extension.m" file implementation

 

 

Just include the above files in your project and replace relevant occurrences of [UIImage imageNamed:] call with [UIImage imageNamedForDevice:]. This would ensure that right image is picked up for non-retina,retina and tall retina versions of the resolution.

 

Tags: , , , , , , , ,

6 comments

  1. Carl
  2. Thierry Passeron

Trackback e pingback

  1. Default.png launch image on iPhone 5 « My iOS development blog
    [...] more elegant solution to Mrs Priya Rajagopal blog, here. Share this:TwitterFacebookLike this:LikeBe the first to like this. This entry…
  2. Default.png launch image on iPhone 5 | My iOS development blog
    [...] more elegant solution to Mrs Priya Rajagopal blog, here. Share this:Like this:Like [...]

Leave a Reply

*