Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 带有反应本机向量图标的动态navIconName工具栏_Android_React Native - Fatal编程技术网

Android 带有反应本机向量图标的动态navIconName工具栏

Android 带有反应本机向量图标的动态navIconName工具栏,android,react-native,Android,React Native,我使用react native vector图标,我希望道具navIconName动态更改,使其具有如下特性: import Icon, {ToolbarAndroid} from 'react-native-vector-icons/MaterialIcons'; ... render() { const NAV_DRAWER_BUTTON = "menu"; const NAV_BACK_BUTTON = "bluetooth" const ICON = thi

我使用
react native vector图标
,我希望道具
navIconName
动态更改,使其具有如下特性:

import Icon, {ToolbarAndroid} from 'react-native-vector-icons/MaterialIcons';

...
render() {

    const NAV_DRAWER_BUTTON = "menu";
    const NAV_BACK_BUTTON = "bluetooth"

    const ICON = this.props.navigationState.key == 'home'? NAV_DRAWER_BUTTON : NAV_BACK_BUTTON;

    return (
        <ToolbarAndroid
            navIconName={ICON}
            onIconClicked={this._onLogoSelected}
            style={styles.toolbar}
            subtitle={this.props.subtitle}
            title={this.props.title} />
    );
}
导入图标,{ToolbarAndroid}来自“react native vector icons/MaterialIcons”;
...
render(){
常量导航抽屉按钮=“菜单”;
常量导航返回按钮=“蓝牙”
const ICON=this.props.navigationState.key='home'?导航抽屉按钮:导航返回按钮;
返回(
);
}
这是可行的,但如果我写
const NAV\u BACK\u BUTTON=“arrow\u BACK”
我有一条消息,上面说使用消息中给定列表中的图标。
如何使用我的图标arrow\u back?

arrow\u back
应该是
arrow back


您可以在此处看到所有材质图标的列表-

您是否尝试过
md arrow back
?我刚刚在react native vector icons github页面(工具栏和Android部分)上读到了它,我使用的右箭头导航返回是“arrow\u back”。谢谢