当我初始化UITabBarController
每个选项卡包含的位置时,每个选项卡UINavigationController
都UINavigationController
包含UIViewController
在UIViewController
我做类似的事情时
TSActivityDetailsVC * c = [[TSActivityDetailsVC alloc] initWithNibName:@"TSActivityDetailsVC" bundle:nil];
[self.navigationController pushViewController:c animated:YES];
我有动画,但是当我按下后退按钮时 - 我没有动画并出现错误
日志:
push view controller
Unbalanced calls to begin/end appearance transitions for <TSActivityMapVC: 0x81b1000>.
back btn pressed
Unbalanced calls to begin/end appearance transitions for <TSActivityDetailsVC: 0x81c85d0>.
初始化代码:
-(UITabBarController *) createMainTabBarController{
UITabBarController * tabbarCntr = [[UITabBarController alloc] init];
[tabbarCntr setViewControllers:[NSArray arrayWithObjects:
[[UINavigationController alloc] initWithRootViewController:[[TSActivityMapVC alloc] init]],
[[UIViewController alloc] init],
[[UIViewController alloc] init],
[[UIViewController alloc] init],
[[UIViewController alloc] init]
, nil]];
[tabbarCntr.tabBar setSelectionIndicatorImage:[UIImage imageNamed:@"selection_indicator"]];
[tabbarCntr.tabBar setBackgroundImage:[UIImage imageNamed:@"tabbar_background"]];
return tabbarCntr;
}
在TSActivityMapVC
我执行
TSActivityDetailsVC * c = [[TSActivityDetailsVC alloc] initWithNibName:@"TSActivityDetailsVC" bundle:nil];
[self.navigationController pushViewController:c animated:YES];
令人惊讶的是,当我转到另一个选项卡并返回 - 之后 - 一切正常,没有错误