【发布时间】:2014-04-09 22:05:01
【问题描述】:
我的视图存在一些问题,我只想允许纵向视图。这是我的代码:
-(BOOL)shouldAutorotate
{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}
这很有效,直到在这个视图上呈现另一种视图。当下一个视图控制器被关闭时,第一个视图控制器似乎忽略了 shouldAutorotate 并且它意外地进入了横向和纵向。我该如何解决这个问题?
编辑:请注意,我正在使用其他使用横向的视图控制器。
【问题讨论】:
标签: ios objective-c orientation uiinterfaceorientation portrait