disable autorotate on a single UIViewController in iOS6

前端 未结 5 1872
自闭症患者
自闭症患者 2020-12-01 06:43

I have a project using UINavigationController and segues working properly good, all of them rotate correctly, the thing is... I just want to disabl

5条回答
  •  时光说笑
    2020-12-01 07:24

    Try to implement that in your UIViewController:

    // implements the interface orientation (iOS 6.x)
    @interface UINavigationController (RotationNone)
    -(NSUInteger)supportedInterfaceOrientations;
    @end
    
    @implementation UINavigationController (RotationNone)
    -(NSUInteger)supportedInterfaceOrientations {
        return UIInterfaceOrientationMaskPortrait;
    }
    @end
    

提交回复
热议问题