不需要 ios 某些设备上的 8 次应用轮换
unwanted ios 8 app rotation on certain devices
我正在 Swift 在 ios 8 上编写一个应用程序,我想确保它只能在所有设备上以纵向模式运行(目前)。我在 "Deployment Info" 下为应用程序选择了 "Portrait" 作为唯一的设备方向,因此:
它在模拟器和 iPhone 6 Plus 上运行良好;然而,在 iPad Mini 上进行测试时,方向发生了变化,尽管它不应该发生变化。
这是一个已知问题还是我在某处缺少配置?
喜欢任何输入。 TIA.
试试这个:
将这些方法粘贴到每个视图的 ViewController 中:
override func shouldAutorotate() -> Bool {
return false
}
override func supportedInterfaceOrientations() -> Int {
return UIInterfaceOrientation.Portrait.rawValue
}
如果对你有用,请告诉我。
我正在 Swift 在 ios 8 上编写一个应用程序,我想确保它只能在所有设备上以纵向模式运行(目前)。我在 "Deployment Info" 下为应用程序选择了 "Portrait" 作为唯一的设备方向,因此:
它在模拟器和 iPhone 6 Plus 上运行良好;然而,在 iPad Mini 上进行测试时,方向发生了变化,尽管它不应该发生变化。 这是一个已知问题还是我在某处缺少配置?
喜欢任何输入。 TIA.
试试这个:
将这些方法粘贴到每个视图的 ViewController 中:
override func shouldAutorotate() -> Bool {
return false
}
override func supportedInterfaceOrientations() -> Int {
return UIInterfaceOrientation.Portrait.rawValue
}
如果对你有用,请告诉我。