0

我的 IOS 应用程序有一个无法修改的登录序列,一旦序列完成,我在应用程序委托中执行以下操作

- (UIViewController*)newRootViewController {
        NViewController *nView = [[NViewController alloc]
                                    initWithNibName:@"NViewController"
                                    bundle:nil];

    UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:nView];
    [nView release];
    return navVC;
  }

进入 nView 后,是否可以添加标签栏控制器,或者如何将 nView 替换为标签栏控制器。

4

1 回答 1

1

您可以创建一个 UITabBarController 然后将您的 NViewController 和其他控制器添加到选项卡栏。

NViewController *nView = [[NViewController alloc]
                          initWithNibName:@"NViewController"
                          bundle:nil];

//Create my tab bar
UITabBarController* myTabController = [[UITabBarController alloc]init];

//Add my tabs
NSArray* tabs = [[NSArray alloc]initWithObjects:nView, nil];
[myTabController setViewControllers:tabs];
于 2013-07-04T22:10:40.260 回答