Search code examples
iosswiftxcodestatusbaruicolor

Changing status bar background


I want the status bar to have a darker tone than the navigation bar? how can i implement this in Swift 2.0 in IOS 9 An exmaple is as attached:enter image description here

I am able to turn the status bars text to white but not the background to a darker tone then the navigation bar? Would i need to a add a separate view over it? And if so how because i cant get it on top of the navigation bar?


Solution

  • Answer:

    let view = UIView(frame: CGRectMake(0, 0, 500, 20))
    view.backgroundColor = UIColor.redColor()
    self.navigationController?.view.addSubview(view)