更改UINavigationController NavigationBar的动画

时间:2010-01-04 19:04:09

标签: iphone animation uinavigationbar

现在我使用[self.navigationController setNavigationBarHidden:NO animated:YES];

导航栏从右向左飞过,有没有办法从上到下放下它?

1 个答案:

答案 0 :(得分:12)

放手一搏:

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];

对我来说很棒。

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