React-native-router-flux: Navigation bar backButtonImage - can we use Icon instead if image

Created on 6 Sep 2016  路  3Comments  路  Source: aksonov/react-native-router-flux

Hi,

I wanted to use Icon (react-native-vector-icons) instead of image in Navigation bar backButtonImage , has anyone tried this, or any alternate way to do this with the same behavior.
Thanks in advance.

Most helpful comment

const ionicon = (icon) => Platform.OS == 'ios' ? `ios-${icon}` : `md-${icon}`;
renderBackButton={(nav) => {
    return nav.navigationState.index ? (
        <TouchableOpacity onPress={Actions.pop}>
            <Icon name={ionicon('arrow-back')} size={26} color='#FFFFFF' />
        </TouchableOpacity>
    ) : null;
}}

All 3 comments

const ionicon = (icon) => Platform.OS == 'ios' ? `ios-${icon}` : `md-${icon}`;
renderBackButton={(nav) => {
    return nav.navigationState.index ? (
        <TouchableOpacity onPress={Actions.pop}>
            <Icon name={ionicon('arrow-back')} size={26} color='#FFFFFF' />
        </TouchableOpacity>
    ) : null;
}}

It didn't work for me when i had the renderBackButton in the root Scene.
But when i put it inside individual scenes, it works smoothly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sreejithr picture sreejithr  路  3Comments

GCour picture GCour  路  3Comments

VictorK1902 picture VictorK1902  路  3Comments

moaxaca picture moaxaca  路  3Comments

willmcclellan picture willmcclellan  路  3Comments