iOS 6 auto rotate confusion

前端 未结 6 734
萌比男神i
萌比男神i 2020-12-29 17:08

I have my entire interface in one Storyboard. How can I make most of the ViewControllers only support a portrait orientation while only a couple supporting all orientations.

6条回答
  •  一整个雨季
    2020-12-29 17:30

    Here is my Subclassed RootNavController.h

    -(BOOL)shouldAutorotate
    {
        return YES;
    }
    -(NSUInteger) supportedInterfaceOrientations
    {
        if (self.topViewController.view.superview)
        {
            return [self.topViewController supportedInterfaceOrientations];
        }
    
        return UIInterfaceOrientationMaskAll;
    }
    - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
    {
        return UIInterfaceOrientationMaskPortrait;
    }
    

提交回复
热议问题