各位晚上好!我想点击它时改变tabnavigator图标的颜色,但我不能这样做 . 你能帮助我或给我另一种选择吗?
const Tabs = TabNavigator({
About : { screen : About },
Search : { screen : Search },
Trois : { screen : Trois },
Quatre : { screen : Quatre }
}, { tabBarPosition: 'bottom', animationEnabled: true, tabBarOptions: { activeTintColor: 'green', inactiveTintColor: 'grey', showIcon: true, showLabel: false, style:{ backgroundColor:'#FFF', borderTopWidth:1, borderColor:'#a2273c' } }, })
static navigationOptions = {
tabBarIcon : ({tintColor}) =>{
return <Image source={require('../icon/un.png')} style={{width:22,height:22,color:tintColor}} />
},
1 回答
如上所述,您可以通过向tintColor prop提供值来更改图像的
tintColor
.