gpt4 book ai didi

iphone - 应用程序因 InterfaceOrientation 而崩溃

转载 作者:行者123 更新时间:2023-11-29 11:04:57 26 4
gpt4 key购买 nike

我的应用程序是基于横向 的。当应用程序在我的设备上运行时,应用程序立即崩溃。

我选择了这两个字段

UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight

我收到这个错误:

Terminating app due to uncaught exception UIApplicationInvalidInterfaceOrientation, reason: Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES

最佳答案

shouldAutorotatesupportedInterfaceOrientations 方法添加到您的 Controller 。

 -(BOOL)shouldAutorotate
{
return YES; //this will auto-rotate the orientation.
}



-(NSUInteger)supportedInterfaceOrientations
{

return UIInterfaceOrientationMaskLandscape; // will force the app to load in landscape, you can change it as per your need.

}

关于iphone - 应用程序因 InterfaceOrientation 而崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14100233/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com