Automatic rotation changes in iOS 6

Source: Internet
Author: User

Some changes have been made to the automatic screen rotation in iOS 6 SDK. For example, for Master-Detail apps, the master viewcontroller does not support screen rotation, and the detail viewcontroller supports screen rotation.

Enable automatic rotation in info. plist or target-Summary, and select the required supported interface orientations. Create uinavigationcontroller + autorotation. H category and disable automatic rotation of the bottom navcontroller as needed:

1234
- (BOOL)shouldAutorotate{    return NO;}

Set in appdelegatewindow.rootViewController
= navController;
, BecauseshouldAutorotateToInterfaceOrientation:Slave
Deprecated from iOS 6 and switchsupportedInterfaceOrientations+preferredInterfaceOrientationForPresentation.

1234567891011121314
- (BOOL)shouldAutorotate{    return YES;}- (NSUInteger)supportedInterfaceOrientations{    return UIInterfaceOrientationMaskAllButUpsideDown;}- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{    return UIInterfaceOrientationLandscapeRight;}

Notes:

  1. Rootviewcontroller needs to be set for window,[window
    addSubview:navController.view];
    Invalid;
  2. shouldAutorotateValid only at the underlying level;
  3. presentModalViewControllerThe previous automatic rotation control is invalid.
    CATEGORY solution.

Http://fann.im/blog/2012/10/22/autorotation-changes-in-ios-6/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.