views:

439

answers:

1

I'd like to have my navigationBar fade out along with my status bar and setting animated: to YES does not work, since it just animates the navigationBar up. I have 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 it does not work.

A: 

Would 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];
Alex Reynolds
Hmm. No, unfortunately that did not seem to do the trick.
Canada Dev