3

我有一个iPad TabBarApplication。我子类的TabbarController使应用程序做出反应的方向变化:不同方向的UITabbar应用程序

@implementation frankenlandTabBarController

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


@end 

现在的问题是,我不希望在这个方向我tabbarapp的ALL viewcontrollers。

在单个控制器中覆盖shouldAutorotateToInterfaceOrientation方法不起任何作用。

有什么想法?

谢谢!

+0

在特定的视图控制器中实现上述'shouldAutorotateToInterfaceOrientation'方法来防止旋转对我有用。 – brutella 2010-11-07 11:00:17

+0

@brutella也在一个tabbar应用程序? – choise 2010-11-08 17:06:19

+0

是的,它确实;) – brutella 2010-11-08 17:35:10

回答

3

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