To make applications "universal" for both the older displays and the new widescreen aspect ratio follow the following steps:
- Download and install latest version of Xcode.
- Set a 4-inch launch image for your app. This is how you get 1136 px screen height (without it, you will get 960 px with black margins on top and bottom).
- Test your app, and hopefully do nothing else, since everything should work magically if you had set auto resizing masks properly.
- If you didn't, adjust your view layouts with proper auto resizing masks or look into Auto Layout if you only want to support iOS 6 going forward.
- If there is something you have to do for the larger screen specifically, then it looks like you have to check height of [[UIScreen mainScreen] bounds] (or applicationFrame, but then you need to consider status bar height if it's present) as there seems to be no specific API for that.
Example:
CGRect screenBounds = [[UIScreen mainScreen] bounds];
if (screenBounds.size.height == 568) {
// code for 4-inch screen
} else {
// code for 3.5-inch screen
}
Also note: The auto-rotation API has changed completely, take a look at that as well if your application supports any rotation other than default.
No comments:
Post a Comment