iOS9之前,状态栏颜色设置方法:
一、在 info.plist 中,将 View controller-based status bar appearance 设为 NO
在app delegate中:
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
3、在个别状态栏字体颜色不一样的vc中
-(void)viewWillAppear:(BOOL)animated{
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}
iOS9 开始,就不能这样设置了. iOS9设置方法如下:
二、在 info.plist 中,将 View controller-based status bar appearance 设为 YES ,或者没有设置。