弹出动画在UITabbarController的第一个UINavigationController中不起作用 [英] Pop animation is not working in first UINavigationController of UITabbarController
问题描述
我不知道我的代码有什么问题.我已经成功开发了应用程序,并且一切正常,除了我第一次启动应用程序时,在侧面优先导航控制器中,弹出动画无法正常工作.似乎是Pop without animation
.当我更改选项卡并返回第一个选项卡时,它的工作正常.并执行push-pop
,然后工作正常.
I don't know what is wrong with my code. i have developed app successfully and all the things working fine except when i launch app first time, In side first navigation controller, the pop animation is not working fine. it seems that Pop without animation
. and its working fine when i changed the tab and come back on first tab. and doing push-pop
then its working fine.
自从一周以来,我一直试图找出问题所在.但是由于冗长的代码而无法获得成功.我尝试了与创建Tabbar Demo
相同的动画,并且效果良好.
I tried to figure out problem since week. but could't get success because of lengthy code. I have tried the same animation with creating Tabbar Demo
and its working fine.
我的应用具有以下层次结构.
My app has following hierarchy.
UINavigationController --> UIViewController --> UITabbarController --> Four UINavigationController --> UIViewControlle.
我在storyboard
中服用了UITabbarController
.
推荐答案
我知道我问了这个问题,并且也提供了解决方案.我很久以前就问过这个问题,但由于存在不合逻辑的错误,我没有得到任何解决方案.并非每个Tabbar
基本应用程序都具有相同的功能.我在这里添加了经过长时间调试的解决方案,发现即使单行也可能破坏您的项目.
I know that i asked the question and also provide solution for same. I have asked this question long time ago and i am not getting any solution for this because there is illogical bugs. Not every Tabbar
base application have same. Here i am adding solution that is result of long time debugging and i found that even single line can break your project.
实际上,我已经从情节提要中添加了UITabbarController
,并以编程方式创建了UITabbarController
类,并在storyboard
内使用UITabbarController
进行了类型转换.
Actually i have added UITabbarController
from storyboard and programmatically created UITabbarController
class and type cast it with UITabbarController
inside storyboard
.
这是我的问题,我忘了在-(void)viewDidAppear:(BOOL)animated
方法中编写[super viewDidAppear:animated];
.所以我会第一次打破流行动画,然后它将正常工作.
Here my problem is, i forgot to write [super viewDidAppear:animated];
inside -(void)viewDidAppear:(BOOL)animated
method. so i will break pop animation first time then it will work fine.
获得此解决方案后,即使我也不知道此行如何影响整个代码.但我不希望其他人浪费时间来发现这样的单行(意外问题)问题.所以我在这里添加此代码.
After getting this solution, even i don't know how this line affect whole code. but i don't want the other people to waste their time to find out such single line (unexpected issue) problem. so here i am adding this code.
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
}
这篇关于弹出动画在UITabbarController的第一个UINavigationController中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!