I\'m basically trying to duplicate the behavior of the iPod app on the iPhone, where when you select a song, the music player view slides in, and the navigation bar transiti
Andrew's answer actually works pretty well, but I would add two things to make it work better:
Here's my category code (I have it in categories of both UINavigationBar and UIToolbar):
- (void)setBarStyle:(UIBarStyle)barStyle animated:(BOOL)animated {
if (animated && self.barStyle != barStyle) {
CATransition *transition = [CATransition animation];
transition.duration = 0.2;
transition.timingFunction = [CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseIn];
[self.layer addAnimation:transition forKey:nil];
}
[self setBarStyle:barStyle];
}
And this is how I use it:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[UIApplication sharedApplication]
setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
[self.navigationController.navigationBar
setBarStyle:UIBarStyleBlackTranslucent animated:YES];
[self.navigationController.toolbar
setBarStyle:UIBarStyleBlackTranslucent animated:YES];
}