在需要隐藏的VC
[[UIApplication sharedApplication] setStatusBarHidden:YES];
plist:
info.plist
key:View controller-based status bar appearance 可以改变状态,如果设置了该属性
Status bar is initially hidden YES
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"> </span><span style="font-family: Arial, Helvetica, sans-serif; color: rgb(255, 255, 255); background-color: rgb(255, 0, 0);">字体颜色</span>
info.plist
key:View controller-based status bar appearance
value:NO 可改变字体颜色 默认不添加为YES 不可改变
//字体 黑色UIStatusBarStyleDefault 白色UIStatusBarStyleLightContent
UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
本来statusbar是lightcontent的,结果用UIImagePickerController会导致我的statusbar的样式变成黑色,怎么办?
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}