I was trying to change the color of the statusBar
on my react-native app.
I am working with expo
and on their documentation they are just specifying to add :
"androidStatusBar": {
"backgroundColor": "#2E1D59"
}
that works fine with android, but they did not mention how to do so with iOS statusBar.
Anyone has an idea about this ?
expo-status-bar gives you a component and imperative interface to control the app status bar to change its text color, background color, hide it, make it translucent or opaque, and apply animations to any of these changes.
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 you use expo-status-bar to control your status bar style, the style="auto" configuration will automatically pick the appropriate default style depending on the color scheme currently used by the app (this is the default behavior, if you leave out the style prop entirely then auto will be used).
You can't change the color of the iOS status bar.
You can use the React Native StatusBar module to either hide it, or set the text color to light (white) or dark (black).
You can just drop the component in your app's root component:
<StatusBar barStyle="light-content" />
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