I have made two different background images for my iPhone app: one in 640x960px (iPhone4s) and one in 640x1136px (iPhone5). But when I create the application layouts in the Xcode 4.5 Main Storyboard, how do I define and create it for both iPhone4s and iPhone5? So that the background automatically updates when i choose iPhone5 screen?
Asked
Active
Viewed 1,088 times
0
-
want to change the splash screen? – Hiren Oct 24 '12 at 18:09
2 Answers
1
Just import your background image with the correct suffix
For example :
myImage.png
for non-retina display
myImage@2x.png
for retina display
myImage-568h@2x.png
for iPhone 5

bs7
- 627
- 4
- 11
0
In your viewController set:
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.jpg"]];
Remember to correctly named the image:
- for iphone4 "image@2x.png"
- for iphone5 "image-568h@2x.png"
-
1Isn't it possible to do this in Interface Builder, without using code? – AVEbrahimi Nov 27 '12 at 14:44