In my case, I override preferredStatusBarStyle in the view controller, then the color is right.
Post
Replies
Boosts
Views
Activity
I did two things to solve this problem, here is the example code:
let webConfiguration = WKWebViewConfiguration()
if UIDevice.current.userInterfaceIdiom != .phone {
let prefer = WKWebpagePreferences()
prefer.preferredContentMode = .mobile
webConfiguration.defaultWebpagePreferences = prefer
}
webView = WKWebView(frame: .zero, configuration: webConfiguration)
if UIDevice.current.userInterfaceIdiom != .phone {
webView.customUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15"
}