I got this Custom Header:
export const HeaderBar = (props) => {
return (
<View style={styles.containerHeader}>
<View style={styles.containerImage}>
<Image source={logo} style={styles.logo} />
</View>
</View>
);
};
const styles = StyleSheet.create({
logo: {
width: 90,
resizeMode: "contain",
alignSelf: "center",
},
});
This shows a header bar with a logo in the center of the bar.
My app.js
<HomeStack.Screen
name="TitleDetails"
component={TitleDetails}
options={{
headerTitle: (props) => <HeaderBar />,
headerStyle: { backgroundColor: "#3B9B88" },
}}
/>
The problem is that when I use the back button of React Navigation, the header moves a little to the right and therefore the logo is off-center.
How can I fix this?