Skip to content

Commit e0d3c90

Browse files
authored
Merge pull request #78 from pwa-builder/bugfix-4839-status-bar-theme-color-priority
fix status bar in iOS using theme color #4839
2 parents ce926d3 + 02f21e1 commit e0d3c90

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Microsoft.PWABuilder.IOS.Web/Resources/ios-project-src/pwa-shell/ViewController.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ class ViewController: UIViewController, WKNavigationDelegate, UIDocumentInteract
6666
}
6767

6868
if #available(iOS 15.0, *), adaptiveUIStyle {
69-
themeObservation = PWAShell.webView.observe(\.underPageBackgroundColor) { [unowned self] webView, _ in
70-
currentWebViewTheme = PWAShell.webView.underPageBackgroundColor.isLight() ?? true ? .light : .dark
69+
themeObservation = PWAShell.webView.observe(\.themeColor) { [unowned self] webView, _ in
70+
let backgroundColor = PWAShell.webView.underPageBackgroundColor;
71+
let themeColor = PWAShell.webView.themeColor;
72+
currentWebViewTheme = themeColor?.isLight() ?? backgroundColor?.isLight() ?? true ? .light : .dark
7173
self.overrideUIStyle()
74+
view.backgroundColor = themeColor ?? backgroundColor;
7275
}
7376
}
7477
}

0 commit comments

Comments
 (0)