iOS: Change status bar text color

The text on the status bar in iOS apps are black-colored by default.

If your app theme has a dark navigation style, you would prefer white text on the status bar.

If you have created your ViewControllers using Storyboard, open the embedding Navigation Controller, and select the Navigation Bar item.

Under attributes inspector, set the style as Black.

That’s it!

If this doesn’t work, here’s how to change the style programmatically

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }

    override func viewDidAppear(_ animated: Bool) {
        navigationController?.navigationBar.barStyle = .black
    }

Also published on Medium.

By |2019-04-04T05:19:29+00:00March 25th, 2019|Categories: iOS Tips|0 Comments

Leave A Comment