statusbar的颜色设置
步骤一、在info.plist文件中添加一行(key:View controller-based status bar appearance,value:NO)
步骤二、在appDelegate中,添加代码:
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
如下,根据不同的版本设置不同的statusbar的颜色:
if ([[[UIDevice currentDevice] systemVersion] doubleValue] < 7.0) { [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; } else { [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; }