我想在标签中显示图标,但是当我将showIcon:true
放在tabBarOptions
中时,我看到此错误:
找不到变量:React
const MenStack = createStackNavigator({
menStackNav: { screen: MenTabScreen, navigationOptions:{tabBarVisible: false},
},
Products: {
screen: ProductsShow,
navigationOptions:{tabBarVisible: false},
},
},{
initialRouteName: 'menStackNav',
headerMode: 'none',
navigationOptions: {
headerVisible: false,
}
});
MenStack.navigationOptions = ({navigation}) => {
let tabBarVisible = true;
if(navigation.state.index > 0){
tabBarVisible = false;
}
return {
tabBarVisible,
}
}
const HomeScreenTabs = createMaterialTopTabNavigator({
Home:{
screen:HomeTabScreen,
navigationOptions: {
tabBarIcon:<Icon name="home" size={30} color="#900" />
}
},
Women: {
screen:WomenTabScreen,
},
Men: {
screen:MenStack,
},
},{
tabBarOptions: {
showIcon:true,
style:{backgroundColor:'#fff'},
activeTintColor: '#0077FF',
inactiveTintColor: '#0077FF60',
indicatorStyle: {
opacity: 0
},
tabStyle:{backgroundColor:'#fff',height:40,borderBottomColor:'#fff'},
labelStyle: {
borderBottomColor:'#fff',
border:0,
fontSize: 14,
fontFamily:'iransans_medium',
},
},
initialRouteName: 'Men',
mode: 'modal',
headerMode: 'none',
});