I'm using react-native-navigation library on my project and i'm having some issues with my status bar. First one is that i'm unable to change my status bar background color on iOS, so i created a component for that as follow:
const S_StatusBar = ({ backgroundColor, ...props }) => (
<View style={[styles.statusBar, { backgroundColor }]}>
<StatusBar translucent backgroundColor={backgroundColor} {...props} />
</View>
);
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 :
StatusBar.currentHeight;
const styles = StyleSheet.create({
statusBar: {
height: STATUSBAR_HEIGHT,
}
});
I import this component on all my screen as followed:
<View>
<S_StatusBar backgroundColor="#090b4b" barStyle="light-content" />
</View>
Here is how i push my screen using the react-native-navigation library:
pushProductDetailScreen = () => {
this.props.navigator.push({
screen: 'cfl.ProductDetail'
});
};
The screen is pushed correctly but now my problem is that my status bar is under my navigation bar such as followed:
I don't understand the issue and why it's happening!