I need for the status bar to fade out when the user taps the screen, and I'm wondering if this is possible using Core Animation. I've set the status bar as so:
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackTranslucent animated: YES];
When I was using UIView animation, and I placed [[UIApplication sharedApplication] setStatusBarHidden:NO];
in the UIView animateWithDuration
block, it made it dissolve. However when I'm using core animation, it's not working:
[CATransaction begin];
CABasicAnimation *fader = [CABasicAnimation animationWithKeyPath:@"opacity"];
[fader setDuration:2.0];
[fader setFromValue:[NSNumber numberWithFloat:.75]];
[fader setToValue:[NSNumber numberWithFloat:0]];
[[[[self tabBarController] tabBar]layer]addAnimation: fader forKey:@"BigFade"];
CABasicAnimation *fader2 = [CABasicAnimation animationWithKeyPath:@"opacity"];
[fader2 setDuration:2.0];
[fader2 setFromValue:[NSNumber numberWithFloat:1]];
[fader2 setToValue:[NSNumber numberWithFloat:0]];
[[[[self navigationController] navigationBar]layer]addAnimation: fader2 forKey:@"BigFade2"];
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[CATransaction commit];
Any ideas on how to get this done in Core Animation (I need to use Core Animation instead of UIView animation)?