Wie blende ich die Beschriftungen in TabNavigator
und zeige nur icons
? Wenn ich folgendes tun:Ausblenden von Labels in TabNavigator - ReactNavigation
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}
}
});
Wenn ich title
vom navigationOptions
entfernen zeigt es den Namen des Tab (Home
oder Search
). Ich möchte nur die Icons anzeigen und die Farbe des aktiven icon
ändern. activeTintColor
funktioniert nicht für Symbole.