1在Info.plist中设置UIViewControllerBasedStatusBarAppearance 为NO
2 在需要改变状态栏颜色的ViewController中在ViewDidLoad方法中增加:
[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

如果需要在全部View中都变色,可以写在父类的相关方法中,或者写到AppDelegate中。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
猜你喜欢
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
  • 2022-12-23
相关资源
相似解决方案