2
我正在构建一个具有TabBarController的应用程序,并且每个选项卡视图都有导航视图控制器。当用户点击标签时,我想让relavent导航视图控制器“重置”到根面板。在TabBarController + NavigationController mix env中,如何在选项卡更改时重置导航?
在我的代码中,我使用下面的方式来初始化选项卡和导航控制器。
viewController1 = [[MyFirstController alloc] init];
UINavigationController *tableNavController = [[[UINavigationController alloc] initWithRootViewController:viewController1] autorelease];
viewController2 = [[MySecondController alloc] init];
UINavigationController *table2NavController = [[[UINavigationController alloc] initWithRootViewController:viewController2] autorelease];
tabBarController.viewControllers = [NSArray arrayWithObjects:tableNavController, table2NavController, nil];
Then appears that all the tab and navigation controller is working automatically. I am not sure where to cut in to let navigation controller view to reset when it is selected.
谢谢。