Tell us which versions you are using:
I'm trying to change the arrow color like the screenshot below. However, I can't set a color on each scene. I can only do it on the root Scene. Am I missing something or it is a bug ?
It works with this code when I'm setting it to the root scene.
<Router >
<Scene key="root" titleStyle={{ color: 'red' }} barButtonIconStyle={{ tintColor: 'green' }}>
<Scene key="connexion" component={Connexion}
hideNavBar={false} title="Connexion" initial={true}/>
<Scene key="signup" component={Signup} hideNavBar={false}
title="PageOne" navigationBarStyle={NavBarStyle.bar.darkNavigationBar}
/>
</Scene>
</Router>
I would like to set each scene style separately (like this code). Is it even possible
<Router >
<Scene key="root" titleStyle={{ color: 'red' }}>
<Scene key="connexion" component={Connexion}
hideNavBar={false} title="Connexion" initial={true}/>
<Scene key="signup" component={Signup} hideNavBar={false}
title="PageOne" navigationBarStyle={NavBarStyle.bar.darkNavigationBar}
barButtonIconStyle={{ tintColor: 'green' }}
/>
</Scene>
</Router>
In each Scene, you can give backButtonTextStyle={{ ... }}
I've tried to add it in the scene with these properties :
But it doesn't work..
Would you try the following @Shakarang
<Scene ... leftButtonIconStyle = {{ tintColor:'red'}} />
You can always drill down into:
node_modules/react-native-router-flux/src/back_chevron.png
and edit "back_chevron.png" however you'd like.
Oh sorry, I misread your initial comment, just realized you're trying to set it for each scene.
leftButtonIconStyle={{ tintColor: 'green' }} is indeed the way to go
This is not working in my project.
Version
"react": "16.0.0-alpha.12",
"react-native": "^0.46.3",
"react-native-router-flux": "^4.0.0-beta.12"
need to update back Icon color.
Same issue, on RNRF 4.0.0-beta.15 is not working leftButtonIconStyle, neither barButtonIconStyle
<Scene
key="root"
headerTintColor="#000"
>
This works for me on [email protected]
headerTintColor
seems correct, but what about size? or, if we want a different back-icon?
Check here for styling your nav bar.
If you want to change icon, you can use leftButtonImage
or renderBackButton
prop in scene.
<Scene
key='HomePage'
component={HomePage}
renderBackButton={<Icon name='chevron-left' />}
/>
like this?
renderBackButton
is not a function
Update:
renderBackButton={() => <Icon name='chevron-left' />}
this renders the arrow correctly, but it doesn't do anything when pressed..
Do we really have to re-implement back functionality ourselves?
@Frexuz This is an issue I'm wrestling with now as well. All I want is to use something like a package icon for the navigation buttons, rather than an image or text.
It seems we have to re-implement the on-touch functionality (most likely routing) ourselves for each scene (i.e. onRight/onLeft doesn't do anything if you choose to use renderBackButton or renderRightButton).
headerTintColor="#000"
its worked me too
<Scene key="root" headerTintColor="#000" >
This works for me on [email protected]
Its worked for me too. RN 0.59
Most helpful comment
Would you try the following @Shakarang
<Scene ... leftButtonIconStyle = {{ tintColor:'red'}} />