关闭模态窗口将父项切换为横向

时间:2012-04-18 03:46:40

标签: ios modalviewcontroller

在这个小测试应用程序中,当你按下+按钮时,我有一个ModalViewController,它会弹出View One。这会产生一个带有三个ViewControllers的NavigationViewController。第一个允许您创建帖子,第二个是允许您选择类别的另一个模态视图,最后一个允许您预览和“发布”它。此时(在createTopic方法中)发送数据,我关闭模态视图:

[self dismissModalViewControllerAnimated:YES];

此时,所有的疯狂都开始了。 View One现在以横向模式呈现,但我已禁用所有直立纵向。此外,因为它们已被禁用,所以它不会切换回肖像。我在哪里失败了?

我甚至不确定要发布给您的代码的哪一部分。帮助

enter image description here

enter image description here

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

在应用程序plist或摘要选项卡中“禁用”竖直纵向不会剪切它。那只是一个发射方向。调用

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
 return UIInterfaceOrientationIsPortrait(interfaceOrientation);
} 

在每个UIViewController中将旋转限制为仅限肖像模式。

相关问题