1.先写 [self setNeedsStatusBarAppearanceUpdate];
2.重写 [self preferredStatusBarStyle];
- (UIStatusBarStyle)preferredStatusBarStyle {
if (self.view.backgroundColor == kWhiteColor) {
return UIStatusBarStyleDefault;
}
return UIStatusBarStyleLightContent;
}
3.即可控制切换
网友评论