Two-stage rotation animation is deprecated. This application should use the smoother single-stage animation

爱⌒轻易说出口 提交于 2019-12-18 15:01:07

问题


I am building a ipad application. when the applications starts i show it in landscape Right mode. But as soon as the application starts I get this message

Two-stage rotation animation is deprecated. This application should use the smoother single-stage animation

I used this method in all my classes

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

I also set my supported interface orientations (iPad) to landscape right in my plist file. How to resolve this warning message?


回答1:


I just realized - after reading this answer - that I was simply using the Tab Bar Controller wrong: the tab bar should only be used as a root controller, however I inserted a navigation controller before it.




回答2:


You can also get this error message if you've run the app with an empty tab bar controller as root in your storyboard. I was just starting on an app and my UITabBarController has no view controllers yet, but is presenting a login modal.




回答3:


The problem is that your app is using one of these methods, which were deprecated in iOS 5.0:

didAnimateFirstHalfOfRotationToInterfaceOrientation:
willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:
willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration:

You need to modify your view controllers to override willAnimateRotationToInterfaceOrientation:duration: instead, and to not override any of the "HalfOfRotation" methods.




回答4:


ckeck your array declaration for tab bar ..possible mistake u done: I declared array oblects after assigning

tabBarController.viewControllers = tabControlArry;
[tabControlArry addObject:navCOntroller];
[tabControlArry addObject:navController1];

correct way:

[tabControlArry addObject:navCOntroller];
[tabControlArry addObject:navController1];
tabBarController.viewControllers = tabControlArry;



回答5:


This error message is related to TabBarController usage. You can expect this error when you don't make your tabBarController as the "root controller" for your app. So make your TabBarController as the root controller & this error will no more pester you.



来源:https://stackoverflow.com/questions/11027764/two-stage-rotation-animation-is-deprecated-this-application-should-use-the-smoo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!