Custom background color for status bar in iOS app created with Xcode and Swift

后端 未结 2 1774
天涯浪人
天涯浪人 2021-01-26 20:29

I already googled a little bit but without success. I want to have a custom background color for the status bar in all my ViewControllers (only in portrait mode). The ViewContro

2条回答
  •  伪装坚强ぢ
    2021-01-26 20:53

    Try this, it will help.

    let demoView = UIView()
    demoView.frame = CGRectMake(0, 0, 320, 22)
    demoView.backgroundColor = UIColor.redColor()
    self.view.addSubview(demoView)
    

提交回复
热议问题