Shouldautorotate Method not called in iOS6

Source: Internet
Author: User

Transferred from: HTTP://STACKOVERFLOW.COM/QUESTIONS/13588325/SHOULDAUTOROTATE-METHOD-NOT-CALLED-IN-IOS6

Reference 1:http://stackoverflow.com/questions/21088956/supportedinterfaceorientations-not-called-with-ios-7

Reference 2:http://stackoverflow.com/questions/12775265/ios-6-shouldautorotate-is-not-being-called

If you had a Navigation Controller managing these views, the shouldautorotate method won ' t is called. You would has to subclass Uinavigationcontroller and override methods Shouldautorotate and Supportedintervalorientations.

From the docs:

Now, IOS containers (such as Uinavigationcontroller) don't consult their children to determine whether they should Autoro Tate

Edit-----

As mentioned below by Lomax, subclassing Uinavigationcontroller was discouraged by Apple. You should try a category instead (this so question explains it well):

@implementation UINavigationController -(BOOL)shouldAutorotate{ // your code}-(NSUInteger)supportedInterfaceOrientations{ (...)}@end

Shouldautorotate Method not called in iOS6

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.