Iphone tabbarcontroller的方向问题+;导航控制器

Iphone tabbarcontroller的方向问题+;导航控制器,iphone,uinavigationcontroller,uitabbarcontroller,Iphone,Uinavigationcontroller,Uitabbarcontroller,我有一个TabBarController,它有两个选项卡。每个选项卡中都有一个NavigationController。现在,如果选择第一个选项卡并旋转应用程序,则应调用第一个选项卡导航控制器的rootViewController的shouldAutorotateToInterfaceOrientation:方法,没错,但当我选择第二个选项卡并旋转设备时,仍会调用第一个选项卡的shouldAutorotateToInterfaceOrientation:方法 我想以不同的方式布局不同的选项卡。

我有一个TabBarController,它有两个选项卡。每个选项卡中都有一个NavigationController。现在,如果选择第一个选项卡并旋转应用程序,则应调用第一个选项卡导航控制器的rootViewController的shouldAutorotateToInterfaceOrientation:方法,没错,但当我选择第二个选项卡并旋转设备时,仍会调用第一个选项卡的shouldAutorotateToInterfaceOrientation:方法

我想以不同的方式布局不同的选项卡。
任何帮助都将不胜感激。感谢

如果每个选项卡的根视图控制器支持另一个方向,则选项卡栏控制器只能更改为该方向。这是有道理的,否则用户在选择另一个选项卡时会以某种方式切换方向。

覆盖此方法并在视图中调用此方法

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
 {
     if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight)
  {

  }
 }