Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 327
Kris Avatar asked Jan 04 '10 19:01

Kris


People also ask

How do I change the navigation bar on my Iphone?

Change the Bar Style A user changes the navigation bar's style, or UIBarStyle , by tapping the “Style” button to the left of the main page. This button opens an action sheet where users can change the background's appearance to default, black-opaque, or black- translucent.

How do I customize the navigation bar in Swift?

Go to the ViewController. swift file and add the ViewDidAppear method. a nav helper variable which saves typing. the Navigation Bar Style is set to black and the tint color is set to yellow, this will change the bar button items to yellow.


1 Answers

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

like image 155
tobyc Avatar answered Sep 30 '22 06:09

tobyc