I have installed Xcode 4.5.1 and I have one app developed for iOS 5. I would like to upgrade the project for I can publish application upgrade including new launch image for 4″ retina display.
The problem is that when I run on iPhone 6 simulator the application shows black bar above and bellow as Apple says. But, when I insert the launch image for new 4″ (640×1136) in this moment, I run on iPhone 6 simulator show correctly the new launch image but background images from App show bad because the app it seems that run with complete screen instead continuing shows black bar above and bellow as I want.
Therefore if I don’t insert new launch image for 4″ I can’t publish any new update of my app, but, if I insert the new launch image for 4″ the app shows wrong all viewcontroller because the background images and layout was design form 3’5″ display… is this correct?
How to I solve this situation, I must control in code if the size of screen is 4″ I put one image from this new resolution if not, the current image?
Your app’s background images will all need to be updated to support the 4″ size. In addition, simply creating versions of the app with a suffix *-568h@2x.png will NOT automatically get them used (like *@2x.png does over *.png).
You’re going to have to modify your code to determine the size of the screen, and if it is 568 in height then you replace the image in your background image view with the -568h version. You can search here for many answers. What I use is fairly simple:
- (void)viewDidLoad { [super viewDidLoad]; // for iPhone 5 // assume self.bgView is a background view CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height; if ([UIScreen mainScreen].scale == 2.f && screenHeight == 568.0f) { self.bgView.image = [UIImage imageNamed:@"SomeImage-568h@2x"]; } ... }