[英]How do I properly lock my viewController in a specific orientation in swift 2?
我想将我的viewController锁定为纵向模式,我尝试使用以下几行,但是它们没有用:
override func shouldAutorotate() -> Bool {
return false
}
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
let orientation: UIInterfaceOrientationMask = [UIInterfaceOrientationMask.Portrait, UIInterfaceOrientationMask.PortraitUpsideDown]
return orientation
}
我如何正确地做到这一点?
如果您只是尝试为应用提供一种方向,请按照以下步骤操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.