ios - UIPopoverController 中的 UIViewController 始终报告为处于纵向模式

标签 ios ipad

我在 UIPopoverController 中有一个 View Controller 。我想根据是否纵向调整ui。

无论我的 iPad 处于什么方向(物理设备),self.interfaceOrientation 总是报告纵向。我将它记录在 -viewWillAppear: 中,它总是纵向的。

为什么?

最佳答案

使用:

UIInterfaceOrientation deviceOrientation = [UIApplication sharedApplication].statusBarOrientation;
识别状态栏方向。

关于ios - UIPopoverController 中的 UIViewController 始终报告为处于纵向模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13204001/

相关文章:

javascript - 使用 createAudioPlayer 播放音频时出错

ios - 我如何从 Swift 中的 anyObject 中提取数据

ios - 使用 Pencil 在 iPad Pro 上为表格 View 添加注释

iphone - 滑动手势有帮助吗?仅 LeftSwipe 有效,而 RightSwipe 无效

iphone - 调整 UIScrollView 的大小

android - Google Analytics for Mobile 上的上一个屏幕路径

ios - 如何从 swift singleton init 抛出错误/异常

iphone - 带有底部填充的 UITextView

ipad - Iphone sdk 在没有整个上下文的情况下保存图纸

ios - 为 iPhone 应用程序设置到期日期