我有三个 Controller 一二三 .首先是navigationController的rootViewController。
在 SecondViewController ,我有一个名为 的协议(protocol)SecondViewControllerDelegate 它有一个委托(delegate)方法
@protocol SecondViewControllerDelegate <NSObject>
- (void)doneSucceed:(NSString *)msg;
@end
在 FirstViewController 中,我有一个按钮,单击它时,执行以下操作
[self.navigationController pushViewController:_s animated:YES];
_s 表示 SecondViewController,其委托(delegate)是 FirstViewController
在 doneSucceed 方法中执行以下操作
- (void)doneSucceed:(NSString *)msg
{
NSLog(@"%@", msg);
[self.navigationController popViewControllerAnimated:YES];
[self.navigationController pushViewController:_t animated:YES];
}
然后错误
nested push animation can result in corrupted navigation bar show, anyone tell me why? THX
最佳答案
问题是您正在调用 pop 和 push 动画背靠背。在 iOS6 中,推送调用基本上被忽略,但在 iOS7 中,推送是在弹出动画时调用的,因此它们是“嵌套的”,您会得到以下信息:
nested push animation can result in corrupted navigation bar show
您可以从 SecondViewController 进行 pop 调用,而不是在 doneSucceed 中弹出。然后等待FirstViewController的viewDidAppear推送ThirdViewController。您可以使用 doneSucceed 方法来切换是否应该转换到 viewDidAppear 上的 ThirdViewController
关于ios - 嵌套推送动画会导致导航栏损坏 PUSH POP PUSH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19886660/