你的IDE是对的,没有使用tabBarIcon,因为这些是stacknavigator的导航选项,它们没有tabBarIcon属性。你应该删除它们,然后在CreateBoottomTabNavigator中对每个屏幕执行此操作
const BottomTabNavigator = createBottomTabNavigator({
Pronostics: {
screen: PronosticsScreen,
navigationOptions: {
tabBarLabel: 'Pronostics',
tabBarIcon: ({ focused }) => (
<TabBarIcon
focused={focused}
name={
Platform.OS === 'ios'
? `ios-paper${focused ? '' : '-outline'}`
: 'md-paper'
}
/>
),
},
},
Bookmakers: BookmakersScreen, //repeat
Stats: StatsScreen,//repeat
},
{
tabBarOptions: {
showIcon: true,
activeTintColor: '#c7943e',
activeBackgroundColor: '#000000',
inactiveTintColor: '#c7943e',
inactiveBackgroundColor: '#000000',
},
});
Source