Fade out UINavigationBarController.navigationBar?

I want my navigationBar

disappeared along with my status bar and setting animated:

to YES

not work because it simply animates navigationBar

up. I've tried the following:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
self.navigationController.navigationBar.alpha = 0.0;
[UIView commitAnimations];
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];

      

But that won't work.

+2


source to share


1 answer


Will this work for you?



CATransition *_navigationAnimation = nil;
[CATransaction begin];
_navigationAnimation = [CATransition animation];
_navigationAnimation.type = kCATransitionFade;
_navigationAnimation.duration = 0.5;
[[self.navigationController.navigationBar layer] addAnimation:_navigationAnimation forKey:@"kNavigationBarAnimationKey"];
[CATransaction commit];

      

0


source







All Articles