热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何知道iOS8中的当前interfaceOrientation?

如何解决《如何知道iOS8中的当前interfaceOrientation?》经验,为你挑选了1个好方法。

现在,interfaceOrientation属性格式中UIViewController已过时,什么是检测当前设备的方向推荐的方法是什么?



1> oren..:

您可以使用 [UIApplication sharedApplication].statusBarOrientation

注意这[[UIDevice currentDevice] orientation]不完全喜欢你的应用程序旋转.文档:

讨论: 属性的值是一个常量,表示设备的当前方向.此值表示设备的物理方向,可能与应用程序用户界面的当前方向不同.有关可能值的说明,请参阅UIDeviceOrientation.

我会检查statusBarOrientation是否有效.


推荐阅读
author-avatar
腾云溪牛_556
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有