如果你想改变状态栏的背景色,你可以试试下边的方法:
UIApplication *app = [UIApplication sharedApplication];
id statusBar = [app valueForKey:@"_statusBar"];
UIView *statusBarV = [statusBar valueForKey:@"_backgroundView"];
statusBarV.backgroundColor = [UIColor blueColor];
如果你修改状态栏的文字颜色,可以试试
- (UIStatusBarStyle)preferredStatusBarStyle{
return UIStatusBarStyleLightContent;
}
效果如下图所示