Supporting orientations for iPad apps
Q: Which orientations should my iPad application support?
A: It is strongly recommended that your application support all orientations. This includes portrait, portrait upside-down, landscape left and landscape right.
If it is essential that your application run in only one orientation (for instance, portrait only), then you should:
Launch in your supported orientation, regardless of the current device orientation.
Avoid displaying any UI element that tells people to rotate the device.
Support both variants of an orientation.
When you are writing your application, consider using UIKit's interface orientation macros. In your UIViewController class, you should implement
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation to return:
UIInterfaceOrientationIsPortrait(interfaceOrientation)- if you support only portrait.UIInterfaceOrientationIsLandscape(interfaceOrientation)- if you support only landscape.
Listing 1 Using an orientation macro in a portrait-only application
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
return UIInterfaceOrientationIsPortrait(interfaceOrientation); |
} |
For more information on orientation support, see the "Device Orientation Can Change" section on the iOS Human Interface Guidelines. See Q&A: Why won't my UIViewController rotate with the device? for possible reasons your view controller does not rotate.
Document Revision History
| Date | Notes |
|---|---|
| 2010-12-10 | Changed references of separate iPhone and iPad Human Interface Guidelines to point to the combined iOS guidelines. |
| 2010-04-13 | New document that describes the recommended orientation support for iPad apps. |
Copyright © 2010 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2010-12-10