gpt4 book ai didi

iphone - 方向错误 :'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'

转载 作者:可可西里 更新时间:2023-11-01 05:22:12 24 4
gpt4 key购买 nike

我正在尝试使用此代码在 View 上强制定向。

-(BOOL)shouldAutorotate
{
return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}

模拟器中的 View 在横向加载时发生了什么,当我将其转换为纵向时,应用程序崩溃并且出现此错误'Supported orientations has no common orientation with the application, and shouldAutorotate is return YES'。我希望发生的是,当您将它变成肖像时,它会保持横向并且不会崩溃。 The supported orientations are in the info.plist

最佳答案

如果你尝试在 shouldAutorotate 中返回 NO?

关于iphone - 方向错误 :'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18642432/

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