2012-07-16 62 views
0

是否可以更改UINavigationController的popToViewController过渡样式?我需要与pushViewController方法相同的样式吗?(我的意思是从右到左样式(pushViewController),而不是从左到右(默认情况下是popToViewController))。navigationController设置弹出过渡样式

+0

检查这个http://stackoverflow.com/questions/9480458/change-animation-transition – Matt 2012-07-16 06:29:19

+0

感谢,但它只是改变了过渡动画。我需要与推式风格相同的流行风格转换。 – 2012-07-16 06:48:32

+0

[如何在基于导航的应用程序中更改Push和Pop动画]的可能重复(http://stackoverflow.com/questions/2215672/how-to-change-the-push-and-pop-animations-in- a-navigation-based-app) – Monolo 2012-07-16 08:27:28

回答

1

对于模态表示的视图控制器,您可以使用modalTransitionStyle属性更改动画。 AFAIK,没有办法改变导航控制器的推动动画(从零开始重建UINavigationController)。 https://github.com/devindoty/iOS-Transition-Pack

OR

[UIView beginAnimations:@"animation" context:nil]; 
[self.navigationController pushViewController: yourviewcontroller animated:NO]; 
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO]; 
[UIView commitAnimations]; 
+0

http://stackoverflow.com/questions/2506647/iphone-flip-animation-when-controller-pushed – Ramz 2012-07-16 07:49:21

+0

这个答案对你是否有用解决你的问题?如果是这样,请接受或评价我的答案 – Ramz 2012-10-12 08:51:58