UINavigation控制器动画



我有一个带有两个选项卡的标签栏应用程序。每个选项卡都有自己的导航控制器,以实现如下方式:

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];

推送动画效果很好,但在流行动画中,只有顶部栏(导航控制器)被动画化,并且视图在没有动画的情况下消失。可能出了什么问题?

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

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

最新更新