我想让navigationBar
淡出我的状态栏并将animated:
设置为YES
不起作用,因为它只是动画navigationBar
。我尝试过以下方法:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
self.navigationController.navigationBar.alpha = 0.0;
[UIView commitAnimations];
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
但它不起作用。
答案 0 :(得分:0)
这对你有用吗?
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];