在我的应用程序中,我希望它的一些幻灯片只允许orientationPortrait。问题是我根本无法在 Xcode 中禁用横向模式。我在下面尝试了以下操作,并在幻灯片的情节提要中设置了肖像。我的理解是,如果你的类连接到标签栏和导航控制器,它可能不会听“标准命令”?在这种情况下,我该怎么做才能禁用除纵向之外的所有方向?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}