-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Status bar color not getting changed #221
Comments
I'm having the same problem! :'( According to the react-native Statusbar docs it is possible to change the style (and background color) of the status bar:
But in react-native-navbar it seems that only the iOS status bar is being styled:
I hope that the Android status bar styling will be added soon :) |
You can use just regular StatusBar component – https://facebook.github.io/react-native/docs/statusbar.html |
But can you use that in conjunction with react-native-navbar? |
Yep. It doesn't render anything by itself, just modifies settings (I know feels counter-intutive, but it's what we get for using react) :) Here is example: https://github.com/alexindigo/ndash/blob/master/app/components/Chrome.js#L151 |
Nice, thanks! :D |
For sure. |
None of the advice on React Native worked for me. I ended up using the advice of React Navigation for my Android app. |
If you are using Expo for React Native then here is the solution for setting Android Status Bar Color.
And then Go to Your Main Component or App.js, import 'StatusBar' from 'react-native'. Then add Following Code in return:
Here, we are setting the status bar color as Black but with 0.2 opacity. Your statusBar Color will be the same as your headerStyle background Color for Stack Navigator but a bit darker. For standard Android App, this is how the StatusBar color is set. Also, Make it translucent so that your app draws under the status Bar and looks nice. It hope this works perfectly for you. |
my status bar color is also not changing here is the code
|
"expo": { |
workaround by adding a view under the status bar as documented in Expo (bottom of page) |
in my IgniteCli project, it started working with a default barStyle |
react-native-general-statusbar npm i --save react-native-general-statusbar import GeneralStatusBarColor from "react-native-general-statusbar";
function MyComponent() {
return (
<View>
<GeneralStatusBarColor
backgroundColor="#00AEEF"
barStyle="light-content"
/>
</View>
);
} |
@ayoubamine react-native-general-statusbar* didnt seem to work for me on Android 10 |
Am I doing something wrong? the statusbar color is not changing. It works on iphone but not on android. My code below
The text was updated successfully, but these errors were encountered: