Statusbar turns white when the webview is loaded on iOS 12
See original GitHub issueBug description: PR #544 introduces a bug where the statusbar turns to UIStatusBarStyleLightContent (white text) when mounting a webview with a Youtube-video inside
To Reproduce:
- Turn the statusbar to default (dark text) using the react-native Statusbar-component
- Mount a webview with an embedded Youtube-video
Expected behavior: Mounting a webview should not affect the statusbar
Environment:
- OS: iOS
- OS version: 12.2
- react-native version: 0.60.4
- react-native-webview version: 6.3.1
What I can tell so far:
- The following line (RNCWKWebView.m, line: 84) registers an event-handler that should only be called when entering/leaving fullscreen-mode:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(toggleFullScreenVideoStatusBars) name:@"_MRMediaRemotePlayerSupportedCommandsDidChangeNotification" object:nil];
- Using NSlog-statements I can see that this event-handler is also called when the webview has finished loading
- This event-handler assumes the webview has just entered fullscreen and turns the statusbar to UIStatusBarStyleLightContent
Issue Analytics
- State:
- Created 4 years ago
- Reactions:13
- Comments:42 (18 by maintainers)
Top Results From Across the Web
status bar disappeared after full screen video in ...
1. This happens with the video player as well when returning from full-screen. · Same issue for me after coming from fullscreen. ·...
Read more >WkWebView always comes up with white background?
Before loading an html resource into a WkWebView, it is always white regardless of whether in dark or light mode.
Read more >react native android 12 status bar text turns white
Present a RN view controller via push. Notice how the status bar is still light-content (i.e. white text) because of the StatusBar code...
Read more >Display content edge-to-edge in your app
Together, the status bar and the navigation bar are called the system bars. Your app achieves an edge-to-edge layout by drawing behind these...
Read more >cordova-plugin-statusbar
On iOS, when you set StatusBar.overlaysWebView to false, you can set the background color of the statusbar by color name. StatusBar.backgroundColorByName("red");.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hitting this same issue, and had to workaround it with:
Would be great if we could get it fixed in react-native-webview.
I am seeing this issue as well, but when a keyboardUI is triggered. I was able to fix this by making the following changes to my RNCWebView.m file:
I agree with the others, it would be nice to know why the keyboardUi triggers this event in the first place.