我要设置默认的活动和非活动
backGroundColor
对于
createMaterialTopTabNavigator
在我的应用程序中。但它不能正常工作。
我试着把那些放在时尚或者
tabBarStyle
而且在
navigationOptions
但这不是答案
Hotel:{
screen: Hotel,
navigationOptions: {
activeBackgroundColor: '#fff',
inactiveBackgroundColor: '#E9EEF6',
header: null, headerMode: 'none',swipeEnabled:false,
tabBarIcon: ({ focused }) => {
const image = focused
? activeHotel
: deactiveHotel
return (
<Image
style={{ width: 50, height: 50 }}
source={image}
/>
)}
}
},
Travel:{
screen: Travel,
navigationOptions:{
header: null, headerMode: 'none',swipeEnabled:false,
activeBackgroundColor: '#fff',
inactiveBackgroundColor: '#E9EEF6',
tabBarIcon: ({ focused }) => {
const image = focused
? activeTravel
: deactiveTravel
return (
<Image
style={{ width: 50, height: 50 }}
source={image}
/>
)}
}
},
},
{
tabBarOptions: {
showIcon : true,
showLabel : false,
tabStyle: {
height :100
},
style: {
backgroundColor : '#E9EEF6',
elevation:0
},
indicatorStyle :{
backgroundColor : 'transparent',
height :20,
}
}
},
{
headerMode: 'none',
navigationOptions: {
headerVisible: false,
},
},
我把它们摆上风格或者
TabStyle
但它不起作用。当我删除
backgroundColor : '#E9EEF6',
两个选项卡的颜色都变为蓝色(默认颜色)。
这个问题有什么答案或建议吗?