UIModalPresentationFormSheet在iPad上的横向模式

问题描述:

我从XIB创建了一个UIViewController视图,modalPresentationStyle设置为UIModalPresentationFormSheet,一切都在肖像模式下工作得很好。当我切换到横向时,视图被移动到左上角(它不是中心的,因为它应该是),大部分它被剪辑。

I created a UIViewController view from XIB with modalPresentationStyle set to UIModalPresentationFormSheet and everything works great in portrait mode. When I switch to landscape the view gets moved upperleft (it's not centered as it should be) and most part of it is clipped.

任何想法为什么这是发生和如何

Any ideas why this is happening and how to solve it?

感谢

好。结果表明,模态控制器和调用控制器的自动旋转功能设置为纵向。

I had this problem as well. Turned out, I had the autorotate function set to Portrait for both the modal controller and the calling controller.