3

我有一个 iPad TabBarApplication。我将 TabbarController 子类化以使应用程序对方向更改做出反应:

@实现 frankenlandTabBarController

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


@end

现在的问题是,我不希望我的 tabbarapp 的所有视图控制器都在这个方向上。

覆盖shouldAutorotateToInterfaceOrientation单个控制器中的方法没有任何效果。

有任何想法吗?

谢谢!

4

1 回答 1

3

无法更改 tabBar 中一个视图的方向,而不能更改另一个视图的方向。如果指定了 TabBar,则所有子视图(选项卡)必须具有相同的方向外观。您必须在每个 ViewController 和 TabBarController 中设置方向。

于 2010-12-20T23:01:42.113 回答