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.
謝謝。