我正在使用 iOS 9 GM 测试我们的应用程序,但在我的 AppDelegate 中根本没有看到调用 supportedInterfaceOrientationsForWindow。
我希望在应用旋转时调用此委托(delegate)函数:
- (UIInterfaceOrientationMask) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
这在 iOS 7/8 中运行良好。有没有其他人看到这个或对可能发生的事情有任何想法?
最佳答案
您需要在“常规目标”设置中选中“需要全屏”框 - 然后它在这里起作用。
我猜背景是,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/