Modal View Controller force Landscape orientation in iOS 6

前端 未结 4 862
陌清茗
陌清茗 2021-02-15 11:41

I have a UITabBarController presented in Portrait mode. On one of the tabs I have a button that shows a UIViewController modally (A simple storyboard segue performs the action).

4条回答
  •  日久生厌
    2021-02-15 11:49

    If you want to force rotation in iOS6, your rootviewController should implement these methods:

    - (NSUInteger)supportedInterfaceOrientations {
        return UIInterfaceOrientationMaskLandscape;
    }
    
    - (BOOL)shouldAutorotate {
        return YES;
    }
    

提交回复
热议问题