- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
FirstViewController *fvc = [[FirstViewController alloc] init];
SecondtViewController *svc = [[FirstViewController alloc] init];
//Create UITabBarController
UITabBarController *theTabBarController = [[UITabBarController alloc] init];
NSArray *viewControllers = [NSSArry arrayWithObjects: fvc, svc, nil];
[theTabBarController setViewControllers:viewControllers];
// Create UINavigationController
UINavigationController *theNavigationController = [[UINavigationController
alloc]initWithRootViewController:theTabBarController];
[[self window] setRootViewController:theNavigationController];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
然后在第一个视图控制器中,我推送到第二个视图
- (IBAction)Page2:(id)sender {
SBHomePageDetailViewController *detailPageViewController = [[SBHomePageDetailViewController alloc] init];
// Pushing to the stack
[[self navigationController] pushViewController:detailPageViewController animated:YES];
}
现在我的 UI 显示了第二个视图,但是,缺少 UITabBarController。当我向后导航时,标签栏视图又回来了。如何保持标签栏控制器在所有 ui 屏幕中可见?