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

时间:2012-11-02 22:41:26

标签: ios ipad

我在UIPopoverController中有一个视图控制器。我想根据它是否是纵向调整ui。

无论我的iPad在哪个方向(物理设备),self.interfaceOrientation始终报告肖像。我正在-viewWillAppear中记录它:它总是肖像。

为什么?

2 个答案:

答案 0 :(得分:2)

使用:

UIInterfaceOrientation deviceOrientation = [UIApplication sharedApplication].statusBarOrientation;

识别状态栏方向。

答案 1 :(得分:2)

弹出窗口中的视图控制器始终处于纵向状态。无论设备保持哪种方式,弹出窗口的方向始终是纵向的。

如果您希望根据设备的方向在视图控制器中执行不同的操作,请查看UIApplication statusBarOrientation

将弹片视为重力。它始终指向下方。

相关问题