• Home
  • About
  • Our Apps
  • Learn
  • Contact
Login

Register

Login
Seemu Apps Seemu Apps
  • Home
  • About
  • Our Apps
  • Learn
  • Contact

Tutorial – Set Status Bar Style

Home ios Tutorial – Set Status Bar Style

Tutorial – Set Status Bar Style

Mar 21, 2016 | Posted by Andrew | ios, swift, tutorial, xcode |

You can simply set the Status Bar Color in XCode using one method. By Default the status bar up the top is black, however you can change it to white with this method.

To do this in your XCode project to set the status bar in a view controller simply add the following method to your view controller class:

    override var preferredStatusBarStyle : UIStatusBarStyle {
        return UIStatusBarStyle.lightContent
    }

And in our viewDidLoad() method we set the background color to red so we can see the Light status bar which is white:

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        self.view.backgroundColor = UIColor.red
    }

This will result in the following:

Screen Shot 2016-03-02 at 6.32.29 pm

DownloadSourceCode

Tags: blackcolorstatusstatus barstatus colorwhite
0
Share

About Andrew

Andrew is a 24 year old from Sydney. He loves developing iOS apps and has done so for two years.

You also might be interested in

Tutorial – Hide Status Bar Programmatically

Mar 2, 2016

Hiding the status bar in iOS using Swift is easy[...]

Tutorial – Set Navigation Bar Color

Mar 3, 2016

You can simply set the Navigation Bar Color in XCode[...]

Welcome

Hi I am Andrew and welcome to Seemu Apps! Have a look around, we provide tutorials for primarily iOS apps.
Bluehost website hosting discount

Seemu’s Studio Setup

Blue Yeti Microphone
Rode Stand
Spider Shock Mount
Mac Keyboard Cover
Screenflow - recording software

Contact Us

We're currently offline. Send us an email and we'll get back to you, asap.

Send Message

Footer

:)

© 2025 · Your Website. Theme by HB-Themes.

  • Home
  • About
  • Our Apps
  • Learn
  • Contact
Prev Next