Possible Duplicate:
How do I support the taller iPhone 5 screen size?
How to make my app 4inch-ready? My app in iOS6GM simulator looks not 4inch-sized. Is there any option in xcode to use all 4 inches?
Some users have reported that it was fixed after adding the startup image [email protected]
(see below).
For updating to iPhone5 I did the following:
Autorotation is changing in iOS 6. In iOS 6, the shouldAutorotateToInterfaceOrientation:
method of UIViewController is deprecated. In its place, you should use the supportedInterfaceOrientationsForWindow:
and shouldAutorotate
methods. Thus, I added these new methods (and kept the old for iOS 5 compatibility):
-(BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
That was all but just remember to test the autorotation in iOS 5 and iOS 6 because of the changes in rotation.
Before iPhone 5 release, I just use
#define kViewHeight 460.f // or 480.f if you don't have a status bar
#define kViewWidth 320.f
But now, I would like to use
#define kViewHeight CGRectGetHeight([UIScreen mainScreen].applicationFrame)
#define kViewWidth CGRectGetWidth([UIScreen mainScreen].applicationFrame)
instead.
But I'm not sure whether it is a good solution. As you see, you would dispatch CGRectGetHeight([UIScreen mainScreen].applicationFrame)
every where you use kViewHeight
. I've tried to use
extern float kViewHeight; // in .h
float kViewHeight = CGRectGetHeight([UIScreen mainScreen].applicationFrame) // in .m
but failed with a compile error.
Though it works well, I think there must be a better workaround. ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With