navigationcontroller和tabbarcontroller

时间:2014-03-26 14:12:56

标签: ios uinavigationcontroller uitabbarcontroller

当我在导航控制器上按下视图控制器vc4时,我可以更改vc4导航项目(标题,条形按钮等)的设置,但是当我在tabbarcontroller中按vc4并更改导航项目设置时,不会显示更改。

当我点击tableviewcontroller中的单元格时,执行下面的代码。 tableviewcontroller被推送到navigationController,这是MyAppDelegate中设置的rootViewController。

UITabBarController* tabBarController = [[UITabBarController alloc] init];
MyViewController1* vc1 = [[MyViewController1 alloc] init];
MyViewController2* vc2 = [[MyViewController2 alloc] init];
MyViewController3* vc3 = [[MyViewController3 alloc] init];

MyNavRootViewController* vc4 = [[MyNavRootViewController alloc] init];
UINavigationController* navController = [[UINavigationController alloc]

                      initWithRootViewController:vc4];


NSArray* controllers = [NSArray arrayWithObjects:vc1, vc2, vc3, navController, nil];
tabBarController.viewControllers = controllers;

[[self navigationController] pushViewController:tabBarController animated:NO];

0 个答案:

没有答案