Xcode 4.5 different iPhone backgroud on iPhone 4s and 5
Asked Answered
M

2

0

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?

Mellott answered 24/10, 2012 at 17:59 Comment(1)
want to change the splash screen?Creese
S
1

Just import your background image with the correct suffix

For example :

myImage.png for non-retina display

[email protected] for retina display

[email protected] for iPhone 5

Singly answered 24/10, 2012 at 18:6 Comment(0)
D
0

In your viewController set:

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

Remember to correctly named the image:

Douai answered 24/10, 2012 at 18:5 Comment(1)
Isn't it possible to do this in Interface Builder, without using code?Hammel

© 2022 - 2024 — McMap. All rights reserved.