UINavigationController后退按钮没有动画 [英] UINavigationController back button not animating

查看:76
本文介绍了UINavigationController后退按钮没有动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

导航控制器的后退按钮动画我遇到了一个奇怪的问题:

I'm having a weird issue with a navigation controller's back button animation:

我的应用程序有一个带有3个标签的标签栏控件,其中一个有导航带有两个后续视图控制器的控制器,第一个只显示一个主表,第二个显示详细信息,当我从详细视图控制器中点击后退按钮时出现问题,而不是滑回主视图控制器它只是弹出视图没有动画。

my app has a tab bar control with 3 tabs, one of them has a navigation controller with two subsequent view controllers, the first one just show a master table and the second one details, the problem comes when I tap the back button from the detail view controller, instead of slide back to the master view controller it just pops the view without animation.

我注意到如果我先去另一个标签,然后再回到这个标签,动画将正常触发。

I've noticed that if I first go to another tab, and then return again to this one, the animation will trigger normally.

我从头开始重建整个应用程序导航但问题仍然存在,任何帮助都表示赞赏。

I've rebuilt the whole app navigation from scratch but the problem still persist, any help is appreciated.

提前致谢! 。

编辑:添加更多信息

这就是我的故事板在该特定分支中的样子:

This is how my storyboard looks like in that particular branch:

这是来自的prepareForSegue Partidos Activos视图控制器:

Here's the prepareForSegue from "Partidos Activos" view controller:

#pragma mark - Segues

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    if ([segue.identifier isEqualToString:@"PartidosEnDia"]) {
        PartidosActivosEnFecha *paf = segue.destinationViewController;
        CalendarCell *senderCell = (CalendarCell *)sender;
        paf.datos = senderCell.dataDic;
    }
}

两个viewController viewDidLoad方法在开始时调用super方法。

Both viewController viewDidLoad methods are calling super at the start of the method.

正如我之前所说的,如果我只是点击其他选项卡然后回到这一个,那么来自Partidos Activos En FechaviewController的滑动动画按预期工作,只有当我启动应用程序并直接转到此viewController时,滑动返回动画才能工作,它只是在没有动画的情况下进入调用者viewController。

As I told before, if I just tap on other tab and then come back to this one, the slide back animation from "Partidos Activos En Fecha" viewController works as expected, it's only when I start the application and go directly to this viewController when the slide back animation doesn't work, and it just gets to the caller viewController without animation.

希望我添加足够的信息,如果不是只是告诉我,我会再次添加。

Hope I added enough info, if not just tell me and I will add it again.

推荐答案

我终于找到了问题所在,我在 viewDidAppear 方法中错过了对 super 的调用,但在 UITabBarController !,我只检查 viewControllers 的选项卡,但不检查 tabbarviewcontroller 。 @rdelmar是对的。

I finally found where the problem was, I was missing a call to super in the viewDidAppear method but in UITabBarController!, I was checking only viewControllers for the tabs but not the tabbarviewcontroller. @rdelmar was right.

这篇关于UINavigationController后退按钮没有动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆