Joe
Joe

Reputation: 244

Changing the animation for UINavigationController NavigationBar

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?

Upvotes: 5

Views: 9616

Answers (1)

tobyc
tobyc

Reputation: 2237

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

Upvotes: 12

Related Questions