0
我想改变我的活动标签标题颜色,我尝试过使用tabBarOptions,但它只是不会工作,我做错了什么? 这是我的代码:无法更改标签栏标签的颜色
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}}
/>
),
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 }}
/>
),
header: null,
}),
},
}),
tabBarOptions:{
activeTintColor: `${tabBarColor}`,
}
}
我读我的文档和搜索的例子,但找不到任何为我工作。 这就像应用程序只是忽略tabBarOptions。
在此先感谢!
首先,谢谢:D,我应该在哪里添加它?你在哪里找到这个文档?我现在再次看着文档,在那里看不到它。 –
我已经添加了参考现在检查 –
谢谢,但我仍然可以在那里看到tabBarOptions解决方案,你确定它改变了吗?我也不知道应该在哪里添加解决方案。 –