How to hide the statusBar when react-native modal shown? -


screenshot of status bar

i want hide status bar, when modal window shown.

my setup following, won't work expected:

<statusbar animated={true} hidden={true}  translucent={true}> 

this known issue , there seems no official/react way fix yet. can follow discussion here:

https://github.com/facebook/react-native/issues/7474

i saw post in discussion proposes hack hide it, haven't tried on project. can upvote trick if works you.

<view style={styles.outercontainer}   <view style={styles.container}>     <statusbar hidden={true}/>     <view style={styles.content}>   </view>   <modal animation={fade} transparent={true}>           {/*modal contents here*/}   </modal> </view> 

a more solid fix may changing theme of activity in native android code.

<resources>     <!-- base application theme. -->     <style name="apptheme" parent="theme.reactnative.appcompat.light.noactionbar.fullscreen">         <!-- customize theme here. -->     </style>     <style name="apptheme.launcher">         <item name="android:windowbackground">@drawable/launch_screen</item>     </style> </resources> 

credits go traviskn , mbashiq proposed fixes above. recommend subscribe issue.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -