0

我到处找,但在 iOS 6 中我找不到这个烦人的旋转问题的解决方案。

出于某种原因,我无法在 iOS 6 中使用旋转方法。他们甚至没有被调用。

例如:

如果我想在 iOS 5 中以纵向模式保持视图,我使用:

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

我了解到 iOS 6 中的新方法应该是:

- (NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskPortrait;
}

我也尝试添加:

-(BOOL)shouldAutorotate
{
    return NO;
}

但它根本不起作用。

请帮忙!

4

1 回答 1

0

如果您拥有所有这些,它应该像在 Info.plist 以及您的控制器中设置支持的方向一样简单。您可以通过项目目标上的“摘要”选项卡执行此操作。

于 2013-02-13T17:25:59.437 回答