I want to hide the status bar, when modal window is shown.
My setup is as following, but it won't work as expected:
<StatusBar animated={true} hidden={true} translucent={true}>
React Practice Course. The Status bar is easy to use and all you need to do is set properties to change it. The hidden property can be used to hide the status bar. In our example it is set to false. This is default value.
In the react native example, the modal is shown when the touchableHighlight component is pressed. Inside showModal function, we use setTimeout method to show the modal for five seconds and then the modal is hidden by setting modalVisible false.
StatusBar is a component exported by the react-native library that helps to modify and style the native status bar in Android and iOS devices.
If your status bar is translucent
, you can set statusBarTranslucent
to the modal
.
Added since React Native 0.62
<Modal {...props} statusBarTranslucent>...</Modal>
Credit: https://github.com/react-native-modal/react-native-modal/issues/50#issuecomment-607535322
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With