gpt4 book ai didi

ios - 如何知道 iOS 8 中的当前 interfaceOrientation?

转载 作者:可可西里 更新时间:2023-11-01 05:02:18 28 4
gpt4 key购买 nike

既然 UIViewController 中的 interfaceOrientation 属性已弃用,那么检测当前设备方向的推荐方法是什么?

最佳答案

您可以使用[UIApplication sharedApplication].statusBarOrientation

请注意 [[UIDevice currentDevice] orientation] 与您的应用程序旋转不完全。文档:

Discussion: The value of the property is a constant that indicates the current orientation of the device. This value represents the physical orientation of the device and may be different from the current orientation of your application’s user interface. See UIDeviceOrientation for descriptions of the possible values.

我会检查 statusBarOrientation 是否有效。

关于ios - 如何知道 iOS 8 中的当前 interfaceOrientation?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27966880/

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