pragma mark - 页面 出现&消失
-
(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];[self setStatusBarBackgroundColor:JKColor(88, 79, 95)];
}
- (void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
[self setStatusBarBackgroundColor:[UIColor clearColor]];
}
//设置状态栏颜色
-
(void)setStatusBarBackgroundColor:(UIColor *)color {
UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
NSLog(@"statusBar.backgroundColor--->%@",statusBar.backgroundColor);
if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
statusBar.backgroundColor = color;
}
}