Cannot rotate interface orientation to portrait upside down

前端 未结 3 962
礼貌的吻别
礼貌的吻别 2021-01-18 10:41

Both on iPhone simulator and iPhone 3GS (iOS 6) I cannot manage to set the orientation to portrait upside down. I have just one ViewController. I\'ve added this code in it:<

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-18 11:12

    I tried many ways for this. It seems only one way it works, but globally through the app, not only for particular view controller.

    First, you have to check on Upside Down of Device Orientation in target general settings.

    Then, in navigation controller extension, you override the supportedInterfaceOrientations method

    extension UINavigationController {
        override public func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
            return .All
        }
    }
    

提交回复
热议问题