[Modal-StatusBar-Android] Statusbar shows up with setHidden(true)
While the modal component is open on an android device with StatusBar.setHidden(true) the StatusBar still shows up.
Is this intended? If yes, is there any workaround?
Edit: On iOS the StatusBar remains hidden when a modal component is open.
Looks like a bug, I never tested StatusBar + Modal, I'll take a look at it when I get some time.
Any idea about this? I lose background color and translucent properties as well. It looks pretty bad.
I have the same problem, iOS works fine indeed
check my comments on #8627 if have any help
Any updates on this?
I have the same problem.
- ReactNative 0.32
- Android 6+
Idem, same problem.
RN: 0.34
+1. RN: 0.34
Component 01 (showBar Hide):
componentWillUnmount() {
StatusBar.setHidden(true)
}
TO
Component 02:
componentWillMount() {
StatusBar.setHidden(false)
}
result: ShowBar SHOW
But
Component 01 (showBar Hide):
componentWillUnmount() {
AppActions.showBar(true)
}
TO
Component 02:
componentDidMount() {
AppActions.showBar(false)
}
result: ShowBar HIDE
Also noticed that if you highlight some text in the modal, the 'Text Selection' menu has a very undesirable transparent look that shows the view below.
Any ideas how to fix this appearance?
Screen shot:

It's amazing that this issue was opened the May 9th and nobody still figured out why it has this behaviour!
@scerelli I've answered months ago to see my answer in #8627, so why this issue is still opening?
@nihgwu honestly i don't know, and the fact that you explained the cause of this problem in an other issue it's even stranger. This fix/feature is not in roadmap at the moment and it's not good at all! it brings a lot of inconsistency inside applications that use a lot of modals and requires the status bar to be hidden.
There are still cases where the statusbar is not updated properly because the activity was null at the time it was updated, I think this happens mostly when moving the app from the background to foreground. I haven't really hit this issue yet since I'm not changing the statusbar much in my apps so I don't have a repro case to try to fix it. If someone wants to spend some time looking into why it happens and possible fixes it would be great.
A quick fix I can think of would be to subscribe to AppState and force an update of the statusbar native values at that time when we are sure the activity is available.
Edit: confused some issues not sure about this one :)
I don't have much time to look into this at the moment, I suspect we'd want to change the dialog window flags to match the current statusbar config. We already set some flags here https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java#L199
To do that we could try to read flags from the main app window and use the same for the modal.
+1 RNv: 0.40
@janicduplessis I already checked this issue. The reason it doesn't work is because WindowInsets is been set to the wrong window. Modal is implemented with Dialog, Dialog will create a window on the top of Activity's Window. So it won't work for now. But I couldn't find a good way to get the Window of Dialog, do you have any idea?
Any news about this issue? Still getting it with RN 0.4.2
I was able to work around this issue by going into my app's android/app/src/main/res/values/styles.xml file and changing the parent theme to Theme.ReactNative.AppCompat.Light.NoActionBar.FullScreen. This essentially disables the status bar by default for your entire app, including for the modal. If you have other screens that need to show the status bar then you can still use the normal StatusBar api to show it if you want.
Here's my full styles.xml file for reference:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.ReactNative.AppCompat.Light.NoActionBar.FullScreen">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme.Launcher">
<item name="android:windowBackground">@drawable/launch_screen</item>
</style>
</resources>
@Traviskn This solution also has a issue, in some time, at bottom of the Modal has a transparent bar , and height equal to StartBar height.
Still happens at 0.43 version.
Any updates?