Fix white flash in dark mode
This commit is contained in:
parent
7944ec6399
commit
c67e6ce45e
|
@ -241,8 +241,10 @@ extension StatusCardControl {
|
||||||
fileprivate func showWebView() {
|
fileprivate func showWebView() {
|
||||||
let webView = setupWebView()
|
let webView = setupWebView()
|
||||||
webView.loadHTMLString("<meta name='viewport' content='width=device-width,user-scalable=no'><style>body { margin: 0; color-scheme: light dark; } body > :only-child { width: 100vw !important; height: 100vh !important }</style>" + html, baseURL: nil)
|
webView.loadHTMLString("<meta name='viewport' content='width=device-width,user-scalable=no'><style>body { margin: 0; color-scheme: light dark; } body > :only-child { width: 100vw !important; height: 100vh !important }</style>" + html, baseURL: nil)
|
||||||
addSubview(webView)
|
if webView.superview == nil {
|
||||||
webView.pinTo(to: imageView)
|
addSubview(webView)
|
||||||
|
webView.pinTo(to: imageView)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,6 +261,8 @@ extension StatusCardControl: WKNavigationDelegate, WKUIDelegate {
|
||||||
webView.uiDelegate = self
|
webView.uiDelegate = self
|
||||||
webView.navigationDelegate = self
|
webView.navigationDelegate = self
|
||||||
webView.translatesAutoresizingMaskIntoConstraints = false
|
webView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
webView.isOpaque = false
|
||||||
|
webView.backgroundColor = .clear
|
||||||
self.webView = webView
|
self.webView = webView
|
||||||
return webView
|
return webView
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue