Xcode 4.5 is different from iPhone iPhone 4s and 5

I made two different background images for my iPhone application: one at 640x960px (iPhone4s) and one at 640x1136px (iPhone5). But when I create application mockups in Xcode 4.5 Main Storyboard, how do I define and create it for both iPhone4 and iPhone5? So that the background updates automatically when I select the iPhone5 screen?

0
source share
2 answers

Just import the background image with the correct suffix

For instance:

myImage.png to display without retina

myImage@2x.png to display the retina

myImage-568h@2x.png for iPhone 5

+1
source

In your viewController installed:

 self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.jpg"]]; 

Remember to name the image correctly:

  • for iphone4 " image@2x.png "
  • for iphone5 " image-568h@2x.png "
0
source

All Articles