【发布时间】:2015-09-19 09:08:55
【问题描述】:
我想将我的 viewController 锁定为纵向模式,我尝试使用以下几行,但它们没有奏效:
override func shouldAutorotate() -> Bool {
return false
}
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
let orientation: UIInterfaceOrientationMask = [UIInterfaceOrientationMask.Portrait, UIInterfaceOrientationMask.PortraitUpsideDown]
return orientation
}
我该如何正确地做到这一点?
【问题讨论】:
标签: ios swift uiviewcontroller orientation