Change iOS7 Status Bar Colour programmatically, mid-run?

后端 未结 2 1726
抹茶落季
抹茶落季 2021-01-05 22:57

I’m trying to change the Status Bar colour mid-run, i.e. not when a controller is loaded. I change the view’s background colour, so I need to change it from the black to whi

2条回答
  •  情歌与酒
    2021-01-05 23:56

    As of Swift 3:

    1. Go to your application Plist and add this as new row & set it as NO.

    View controller-based status bar appearance NO

    2.

    White: UIApplication.shared.statusBarStyle = .lightContent

    Black: UIApplication.shared.statusBarStyle = .default

提交回复
热议问题