I created a project using CRNA that uses React-Navigation. In one of the screen I have a background image that cover the entire screen and I want to including the header.
Like this image :
Should I just hide the header and use a View that contains the element that I want? If yes will this cause any trouble in case of deep linking?
React Navigation offers a cool props called headerTransparent that can be used in order to render something under the header.
So the code at the should look like this :
static navigationOptions = { headerTransparent: true }
The option to Enable Transparent Header can be found in Appearance > Customize > Header. Once that option is selected, a new option will appear to Show Transparent Header on the Homepage Only.
React Navigation offers a cool props called headerTransparent that can be used in order to render something under the header. when i set headerTransparent=true , my back button in header is not working..you have any solution regarding this. Can you share your code? and remember is headerTransparent : true not headerTransparent = true!
There is one value which the backgroundColor supports which is transparent. Using the transparent value we can easily set any View component background to Transparent which will make the Beneath View visible. This type of designing is mostly used to make the view overlap in react native applications.
This may not be an issue for a lot of apps, but if you're experiencing performance issues during navigation, consider using @react-navigation/native-stack instead - which uses native navigation primitives.
headerBackImage Function which returns a React Element to display custom image in header's back button. When a function is used, it receives the tintColor in it's argument object. Defaults to Image component with back image source, which is the default back icon image for the platform (a chevron on iOS and an arrow on Android).
Right now with React Navigation 5 we can do something like this:
{ headerShown: true, headerTransparent: true, }
For example:
const Screen = ({ navigation }) => { navigation.setOptions({ headerShown: true, headerTransparent: true, }); return ( <View> <Text>Render your component</Text> </View> ); };
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