Hello,
I’m new to Expo Client and I have a problem with my React Native app and I don’t know how to fix it:
Since the update of Expo Client, when I’m running my app on Expo I see that my headers have a padding at the top that wasn’t there before (I’m expected the icons to be vertically centered) :
Even reducing the height of the header didn’t fix it, the only thing I can say is that this problem is fixed if I remove all headers customizations such as :
static navigationOptions = ({ navigation }) => {
return {
headerTitle: ({ style }) => {
return (
<View>
<StatusBar barStyle="dark-content" backgroundColor="#6a51ae" />
</View>
);
},
headerStyle: {
textAlign: 'center',
width: '100%',
...elevationShadowStyle(0, true)
},
headerTitleStyle: {
color: 'black'
}
};
};
and
static navigationOptions = ({ navigation }) => {
return {
headerTitle: ({ style }) => {
return (
<View>
<StatusBar barStyle="dark-content" backgroundColor="#6a51ae" />
</View>
);
},
headerStyle: {
backgroundColor: '#f6f6f5',
textAlign: 'center',
width: '100%'
},
headerLeft: (
<TouchableOpacity
onPress={() => {
navigation.navigate('Home');
}}
style={{ paddingLeft: 20, paddingRight: 10 }}
>
<FontAwesome name={'home'} size={30} color={'#1E1E1E'} />
</TouchableOpacity>
)
};
};
How can I fix this problem and keep my headers parameters?
Thanks in advance for your answers,
Lola P
[EDIT] 02/04/2020 : I think I found what the problem is, for Android the whole screen is not overlapping the StatusBar anymore (so the Android StatusBar has the same color on every screen), and the padding going “behind” the Status Bar is now visible, because the whole screen moved under this status bar. I still don’t know how to fix it.