iOS Custom Status Bar Background Color not displaying

后端 未结 9 1855
别那么骄傲
别那么骄傲 2020-12-16 13:30

I am trying to fill the status bar background color to orange using the following

UINavigationBar.appearance().tintColor = UIColor.orangeColor()
UINavigation         


        
9条回答
  •  别那么骄傲
    2020-12-16 14:07

    This is how I did it without adding a view in a VC with in a NavBarController

    I wanted the color of the status bar to be the same as the VC view color so I just wrote:

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.grayColor()
        self.navigationController?.navigationBar.clipsToBounds = true
    }
    

    Try it.

提交回复
热议问题