0

我有一个带有两个选项卡的 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];

当我想将视图推送到一个选项卡中时,我使用这个:

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

当我在推送视图上并且我想弹出我使用的视图时:

[self.navigationController popViewControllerAnimated:YES];

推送动画效果很好,但在弹出动画中,只有顶部栏(NavigationController)被动画化,并且视图在没有动画的情况下消失。有什么问题?

4

1 回答 1

0

尝试使用[self.navigationController popToRootViewControllerAnimated:YES];

而不是[self.navigationController popViewControllerAnimated:YES]; 告诉我这是否有效。记住 netsted 导航控制器。

于 2012-05-02T19:10:02.267 回答