gpt4 book ai didi

ios - 方向方法不适用于 iPhone plus 设备

转载 作者:行者123 更新时间:2023-12-02 07:58:59 24 4
gpt4 key购买 nike

下面提到的方向委托(delegate)方法在 iOS plus 设备(iPhone 8plus/7plus/6plus...)的情况下不会调用

我的定向方法代码是:

注意:默认情况下,横向右侧复选框处于未选中状态。

- (BOOL)shouldAutorotate {
return NO;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeRight;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationLandscapeRight;
}

我的 info.plist 文件是:

<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>

请指导我解决这个问题。

最佳答案

尝试在 View 中添加通知

UIDeviceOrientationDidChangeNotification

并检查它是否出现在方法中。

此外,您在 UIDeviceOrientationDidChangeNotification 方法中返回“否”,请尝试返回"is"。

希望这有帮助。如果您需要更多解释,请告诉我。这种方法对我来说很有效。

关于ios - 方向方法不适用于 iPhone plus 设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56854258/

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