Changing the animation for UINavigationController NavigationBar

混江龙づ霸主 提交于 2019-12-18 11:17:53

问题


Right now when I use [self.navigationController setNavigationBarHidden:NO animated:YES];

The navigation bar flies in from right to left, is there a way to drop it down top to bottom?


回答1:


Give this a go:

CATransition *transition = [CATransition animation];
transition.duration = kAnimationDuration;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromTop;
transition.delegate = self;
[self.navigationController.view.layer addAnimation:transition forKey:nil];

self.navigationController.navigationBarHidden = NO;
[self.navigationController pushViewController:tableViewController animated:YES];

Worked great for me.

Source: http://www.iphonedevsdk.com/forum/iphone-sdk-development/25045-navigation-controller-custom-animation.html



来源:https://stackoverflow.com/questions/2001466/changing-the-animation-for-uinavigationcontroller-navigationbar

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