当按下后退按钮时,返回 UINavigationViewController 中的上一个视图不会有动画效果

发布于 2024-12-20 15:16:30 字数 360 浏览 4 评论 0原文

UITabBarController 是可能的应用程序的根。 每个选项卡的根是不同的 UINavigationViewController,我在其上推送 UITableViewController。

问题是,当我按下后退按钮时,导航栏会动画,但上一个表格视图会立即出现,而没有动画。 UITableViewController 和 UINavigationViewController 都不是子类,并且我没有任何用于弹出功能的自定义代码。

前段时间,当我在开发另一个iOS应用程序时,我没有遇到这样的问题。 唯一的区别是,现在我使用 XCode 4 和 iOS 5 SDK。

我花了很多时间来寻找答案,但没有找到类似的东西。

有什么线索吗?

UITabBarController is the root in may application.
The root of each tab is different UINavigationViewController on which I am pushing UITableViewController's.

The problem is that when I press on the back button the navigation bar animates, but the previous table view appears instantly without animation. Neither UITableViewController nor UINavigationViewController is sub-classed and I have no any custom code for pop functionality.

Some time ago, when I was working on the other iOS application, I had not such problem.
The only difference is that now I am working with XCode 4 and iOS 5 SDK.

I have spent a lot to find the answer but haven't found anything similar.

Any clue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

究竟谁懂我的在乎 2024-12-27 15:16:31

我自己也为此苦苦挣扎了很长一段时间。就我而言,问题最终是我意外地覆盖了 viewDidAppear 而不是在我的自定义 UITabBarController 类中调用 [super viewDidAppear:animated] 。

一旦我摆脱了这个问题,问题就终于消失了。

I was struggling with this myself for quite a while. In my case the problem ended up being me accidentally overriding viewDidAppear and not calling [super viewDidAppear:animated] in my custom UITabBarController class.

Once I got rid of that the issue finally went away.

揽月 2024-12-27 15:16:31

我终于找到了问题所在:
我不小心将我的根视图设置为窗口的子视图,

[self.window addSubview:rootController.view];

而不是

self.window.rootViewController = rootController;

一旦我修复了它,问题就消失了:)

I have finally found the problem:
I have set accidentally my root view to be subview of the window

[self.window addSubview:rootController.view];

rather than

self.window.rootViewController = rootController;

Once I have fixed it the problem gone:)

南冥有猫 2024-12-27 15:16:31

不要在后台线程中执行任何 UI 更新任务,也不要在 ios 7 中调度 asyncq 后台队列,如果您正在执行任何 ui 相关任务,请在主队列中执行。

        dispatch_async(dispatch_get_main_queue(), ^
                       {
                       //update ui
                       }

这将解决导航控制器动画相关的问题。

Do not do any UI updation task in background thread or dispatch asyncq background queue in ios 7 ,if you are doing any ui related task then do it in main queue.Eg.

        dispatch_async(dispatch_get_main_queue(), ^
                       {
                       //update ui
                       }

This will solve navigation controller animation related issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文