ios - 在 iOS 9 AppDelegate 中未调用 supportedInterfaceOrientationsForWindow

标签 ios objective-c ios9

我正在使用 iOS 9 GM 测试我们的应用程序,但在我的 AppDelegate 中根本没有看到调用 supportedInterfaceOrientationsForWindow。

我希望在应用旋转时调用此委托(delegate)函数:

- (UIInterfaceOrientationMask) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window 

这在 iOS 7/8 中运行良好。有没有其他人看到这个或对可能发生的事情有任何想法?

最佳答案

您需要在“常规目标”设置中选中“需要全屏”框 - 然后它在这里起作用。

enter image description here

我猜背景是,Apple 希望我们提供所有方向,而且这些都适用于 iOS 9 分屏、滑过等。

请参阅他们的文档 here

寻找“表征您的应用并确定您的工作范围”:

Adopt Slide Over and Split View unless you have a specific reason not to. From a customer’s perspective, an iOS 9 app that doesn’t adopt Slide Over and Split View feels out of place.

Consider opting out only if your app falls into one of these narrow categories:

Camera-centric apps, where using the entire screen for preview and capturing a moment quickly is your primary feature Full-device apps, such as games that use iPad sensors as part of their core gameplay

关于ios - 在 iOS 9 AppDelegate 中未调用 supportedInterfaceOrientationsForWindow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32621014/

相关文章:

ios 添加一个对象作为 subview 并释放会给出 EXC_BAD_ACCESS 异常,为什么?

objective-c - iPhone 中的 Sqlite3 数据库被锁定 - 如何避免?

objective-c - 在 Objective-C 中覆盖类别定义的方法是否安全?

html - 实现浏览器的 'Download to Computer'功能

iphone - 电话链接在 iOS 9 中不起作用

ios - 如何在不对每个键使用 if 的情况下解析 json 时捕获错误?

iOS9 通用链接不适用于 Safari,但适用于其他应用程序

ios - NSData dataWithContentsOfURL 用于相机胶卷中的 URL

ios - 用户界面窗口?没有成员命名边界

iOS自动转换调用的号码