我正在使用反应原生矢量图标来显示工具栏上的操作图标。但它似乎并不奏效。反应原生ToolbarAndroid操作图标不起作用
进口&图标
import Icon from 'react-native-vector-icons/FontAwesome';
const myIcon = (<Icon name="compass" size={30} color="#900" />)
主要观点
<View style={styles.containerToolbar}>
<ToolbarAndroid style={styles.toolbar}
title="Test"
actions={toolbarActions}
onActionSelected={this.onActionSelected}>
</ToolbarAndroid>
</View>
var toolbarActions = [
{title: 'Compass', icon:{myIcon} show: 'always'}
];
哪里是你的onActionSelected方法? –
为什么这很重要? – Coder