0

2 つのタブを持つ tabBar アプリがあります。各タブには、次のように実装された独自の navigationController があります。

FirstViewController *firstController = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UINavigationController *firstNavController = [[UINavigationController alloc] initWithRootViewController:firstController];

SecondViewController *secondController = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
UINavigationController *secondNavController = [[UINavigationController alloc] initWithRootViewController:secondController];

tabBar.viewControllers = [NSArray arrayWithObjects:firstNavController, secondNavController, nil];

ビューを1つのタブにプッシュしたいときは、これを使用します:

[self.navigationController pushViewController:activityController animated:YES];

そして、プッシュされたビューを使用していて、使用するビューをポップしたい場合:

[self.navigationController popViewControllerAnimated:YES];

プッシュ アニメーションはうまく機能しますが、ポップ アニメーションではトップ バー (NavigationController) のみがアニメーション化され、ビューはアニメーションなしで消えます。何が間違っている可能性がありますか?

4

1 に答える 1

0

使ってみて[self.navigationController popToRootViewControllerAnimated:YES];

代わりに[self.navigationController popViewControllerAnimated:YES]; 、これが機能するかどうか教えてください。ネストされたナビゲーション コントローラーについては覚えておいてください。

于 2012-05-02T19:10:02.267 に答える