Set different supportedInterfaceOrientations for different UIViewControllers

后端 未结 2 1917
傲寒
傲寒 2020-12-20 01:35

So, as by the question, I use the following code to set userinterfaceOrientation for the viewcontroller.

- (BOOL) shouldAutorotate
{
    return YES;
}

-(NS         


        
2条回答
  •  遥遥无期
    2020-12-20 02:17

    I was able to accomplish this by placing my supported orientation logic in a custom UINavigationController. I then segue to the relevant view controller.

    @implementation PortraitNavigationController
    
    - (NSUInteger)supportedInterfaceOrientations{
        return UIInterfaceOrientationMaskPortrait;
    }
    

    ...

提交回复
热议问题