代码之家  ›  专栏  ›  技术社区  ›  choise

不同方向的uitabar应用

  •  3
  • choise  · 技术社区  · 15 年前

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

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

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

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

    有什么想法吗?

    1 回复  |  直到 15 年前
        1
  •  3
  •   user207616 user207616    14 年前

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