如何隐藏标签TabNavigator
并仅显示icons
?如果我执行以下操作:
const Tabs = TabNavigator({
Home: {
screen:MainHome,
navigationOptions: ({ navigation }) => ({
title: "Home", //Tried to hide this for next tab Search.
tabBarIcon: ({ tintColor, focused }) => <View><MaterialIcons name="home"/></View>
})
},
Search: {
screen:TestComp1,
navigationOptions: ({ navigation }) => ({
//If no title it shows the name as Search.
tabBarIcon: ({ tintColor, focused }) => <View><MaterialIcons name="accessibility"/></View>
})
}
}, {
tabBarPosition: 'bottom',
tabBarOptions: {
showIcon: true,
activeTintColor: '#e91e63', //Not working for icons.
inactiveBackgroundColor: 'green', // Not working at all.
style: {backgroundColor: '#3498DB', height: 60, padding:0, margin:0}
}
});
title
如果我从中删除navigationOptions
它会显示选项卡(Home
或Search
)的名称。我只想显示图标并更改活动的颜色icon
。activeTintColor
不适用于图标。