gpt4 book ai didi

iPhone UI 导航问题 - 嵌套推送动画可能会导致导航栏损坏

转载 作者:行者123 更新时间:2023-12-03 18:09:09 25 4
gpt4 key购买 nike

我不断收到以下错误:

2011-04-02 14:55:23.350 AppName[42430:207] nested push animation can result in corrupted navigation bar
2011-04-02 14:55:23.352 AppName[42430:207] nested push animation can result in corrupted navigation bar
2011-04-02 14:55:23.729 AppName[42430:207] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2011-04-02 14:55:23.729 AppName[42430:207] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

这就是我正在做的事情。当按下某个按钮时,我从 View Controller 调用以下命令:

EventsViewController *viewController = [[EventsViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
navController.navigationBar.tintColor = [UIColor blackColor];
[self presentModalViewController:navController animated:YES];
[viewController release];
[navController release];

然后,如果在 EventsController 中按下某个按钮,我会调用:

SingleEventViewController *viewController = [[SingleEventViewController alloc] initWithEvent:[currentEvents objectAtIndex:indexPath.row]];
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];

然后,如果在 SingleEventViewController 中按下某个按钮,我会调用:

EventMapView* viewController = [[EventMapView alloc] initWithCoordinates];
[[self navigationController] pushViewController:viewController animated:YES];
[viewController release];

所以,是的,很明显有嵌套的推送动画,但这不是正确的方法吗?我查看了 Apple 的 DrillDownSave 代码,这似乎就是他们的做法。我使用 init 方法而不是 viewDidLoad 方法有什么关系吗?

最佳答案

viewDidAppear 之前调用 pushViewController 是不安全的。

关于iPhone UI 导航问题 - 嵌套推送动画可能会导致导航栏损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5525519/

25 4 0