There is no way to change the color of the status bar contents like text, icons. You can only switch between dark and light styles of the status bar.
// in your view controller
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent // or .darkContent or .default
}
You will need to call setNeedsStatusBarAppearanceUpdate()
when you want to refresh status bar style.
It is possible to change the background color of the view behind the status bar. Simply make sure that the view is not constrained to the safe area layout guide, but to the topAnchor of the view controller that contains the web view.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…