0

Is there any way to set statusbar lightcontent color to a UITableViewController?

Looks like there is no function

override open var preferredStatusBarStyle: UIStatusBarStyle{
        return UIStatusBarStyle.lightContent
    }

in UITableViewController

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Akshay Sood
  • 6,366
  • 10
  • 36
  • 59

2 Answers2

1

Adding barStyle to black fixed the problem

self.navigationController?.navigationBar.barStyle = .black
Akshay Sood
  • 6,366
  • 10
  • 36
  • 59
-1

If you use Navigation Bar

Try this

override func viewDidLoad() {
        super.viewDidLoad()
    navigationController?.navigationBar.barTintColor = UIColor.green
}

If you don't use Navigation Bar only change color Background view

override func viewDidLoad() {
            super.viewDidLoad()
        view.backgroundColor = UIColor.green
    }