0

在我的应用程序中,我添加了 UITabBarController *rootController;

didFinishLaunchingWithOptions我完成了这段代码。为此我写了

 WaylistController *waylistNavigationControllerTemp = [[WaylistNavigationController alloc] initWithNibName:@"WaylistNavigationController" bundle:nil];
      self.waylisyViewController = waylistNavigationControllerTemp;
      UINavigationController * waylistNavigationController = [[UINavigationController alloc] initWithRootViewController:waylisyViewController];
      [waylistNavigationControllerTemp release];

WayRoomController *wayRoomNavigationControllerrTemp = [[WayRoomNavigationController alloc] initWithNibName:@"WayRoomNavigationController" bundle:nil];
      self.WayRoomViewController = wayRoomNavigationControllerrTemp;
      UINavigationController * wayRoomNavigationController = [[UINavigationController alloc] initWithRootViewController:WayRoomViewController];
      [wayRoomNavigationControllerrTemp release];


rootController.viewControllers = [NSArray arrayWithObjects: WaylistNavigationController,//0
                                    WayRoomNavigationController,//1                       
                                     nil]
[rootController setSelectedIndex:0];

为此,我没有得到汽车东方总是只得到爱国者。有人请帮帮我吗?

4

2 回答 2

0

检查 .plist 文件中的设置以获取支持的界面方向..

于 2012-10-06T08:50:19.963 回答
0

把它放在你需要方向的控制器类中。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
 // Return YES for supported orientations
  if((interfaceOrientation == UIInterfaceOrientationPortrait) || (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) || (interfaceOrientation == UIInterfaceOrientationLanscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight))
    return YES;

}

还要确保在您的项目设置中启用了所有方向。在您的 .xib 文件中,使用自动调整大小来缩放两个方向。

于 2012-10-06T08:34:32.063 回答