我希望在未选择选项卡时颜色为默认灰色,但在选择tabBarColor
选项卡时为我的颜色。我找不到更改标签栏中标题颜色的方法。
我怎样才能做到这一点?
这是我的代码:
Home:{
screen: TabNavigator({
Home: {
screen: HomeScreen,
navigationOptions: ({ navigation }) => ({
title: 'Home',
tabBarIcon: ({ tintColor, focused }) => (
<Ionicons
name={focused ? 'ios-home' : 'ios-home-outline'}
size={26}
style={{ color: focused ? `${tabBarColor}` : tintColor}}
/>
),
//headerStyle: {backgroundColor: "#553A91"},
//headerTitleStyle: {color: "#FFFFFF"},
header: null,
}),
},
Profile: {
screen: ProfileScreen,
navigationOptions: ({ navigation }) => ({
title: 'Profile',
tabBarIcon: ({ tintColor, focused }) => (
<Ionicons
name={focused ? 'ios-people' : 'ios-people-outline'}
size={26}
style={{ color: focused ? `${tabBarColor}` : tintColor }}
/>
),
//headerStyle: {backgroundColor: "#553A91"},
//headerTitleStyle: {color: "#FFFFFF"},
header: null,
}),
},
}),
}