[英]Xcode not obeying device orientation
我已將設備方向設置為僅在 Xcode 中檢查“縱向”。 但是,當我在模擬器中運行我的應用程序時,它會在所有方向上旋轉。
以前有人遇到過同樣的問題嗎? 謝謝
Xcode 中的“General”->“Deployment Info” UI 可能具有欺騙性。 檢查info.plist
這兩個鍵:
UISupportedInterfaceOrientations
和
UISupportedInterfaceOrientations~ipad
我有同樣的問題,花了我一整天的時間,我通過這樣做解決了:覆蓋 AppDelegate 方法
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
if self.allowOrentitaionRotation {
return .allButUpsideDown;
}
return .portrait;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.