我使用IB创建了一个使用TabBarController的应用程序,该应用程序有4个TabBarItems,因此显示了4个不同的ViewControllers。为了允许景观定向,我必须在我的所有ViewController中添加以下代码:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ? NO : YES);
}问题是,我不希望例如secondViewController自动访问,我如何做到这一点?因为每次在我的ViewController中删除上面的代码时,每个ViewControllers都不再旋转。
谢谢
发布于 2010-03-14 18:12:04
将代码留在那里,但是您需要做两件事中的一件:
。
例:
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES]https://stackoverflow.com/questions/2442385
复制相似问题