要改变StatusBar的显示样式需要在UIViewController中重载:
- (UIStatusBarStyle)preferredStatusBarStyle{ return UIStatusBarStyleLightContent;}
这个方法不能直接调用,在需要改变样式的地方调用:[self setNeedsStatusBarAppearanceUpdate] 示例:
- (void)viewWillAppear:(BOOL)animated{ [self setNeedsStatusBarAppearanceUpdate];}