【发布时间】:2017-01-23 12:08:19
【问题描述】:
试图关闭该用户无法更改方向..
我在风景中有我的观点,它必须在风景中,所以我这样做
let value = UIInterfaceOrientation.landscapeLeft.rawValue
UIDevice.current.setValue(value, forKey: "orientation")
而且这个用户不能改变旋转
private func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.landscapeLeft
}
private func shouldAutorotate() -> Bool {
return false
}
问题是它不起作用。我在推动景观后,但我仍然可以旋转它。
【问题讨论】:
标签: ios swift rotation swift3 orientation