我正在尝试使用 react-navigation 设置一个简单的屏幕导航栏。我的导航工作正常,但无法在每个选项卡上显示任何图标。
我尝试使用 FontAwesome 而不是 IonicIcons,但是带有 X 的同一个 Box 代替了所需的图标。
import React, {Component} from 'react';
import {createBottomTabNavigator, createAppContainer} from 'react-navigation';
import Icon from 'react-native-vector-icons/Ionicons';
import HomeScreen from './screens/HomeScreen'
import SearchScreen from './screens/SearchScreen'
import ScanScreen from './screens/ScanScreen'
const TabNavigator = createBottomTabNavigator({
Home: {
screen: HomeScreen,
navigationOptions: {
tabBarIcon: () => (<Icon name="md-home" />)
}
},
Scan: {
screen: ScanScreen
},
Search: {
screen: SearchScreen
}
});
export default createAppContainer(TabNavigator);