I m creating my first react-native application and i wanted to change css for drawer navigation.i have already tried changes color with activeTintColor but its not working.I just wanted to change the icon color or the menu item which is active.
What i have done is here:
const DrawerNavigation = createDrawerNavigator({
Page1: {
screen: MainTabNavigator,
navigationOptions: {
drawerLabel: 'Home'
},
contentOptions: {
activeTintColor: 'rgb(234, 94, 32)'
}
},
page2: {
screen: AboutUs,
navigationOptions: {
drawerLabel: 'About Us'
},
contentOptions: {
activeTintColor: 'rgb(234, 94, 32)'
}
},
Page3: {
screen: LogoutScreen,
navigationOptions: {
drawerLabel: 'Logout'
},
contentOptions: {
activeTintColor: 'rgb(234, 94, 32)'
}
}
},
{
initialRouteName: 'Page1',
contentComponent: CustomDrawerContentComponent
});
If you need to use the same color for all the menu items when active, This will help you,
const DrawerNavigation = createDrawerNavigator({
Page1: {
screen: MainTabNavigator,
navigationOptions: {
drawerLabel: 'Home'
},
},
page2: {
screen: AboutUs,
navigationOptions: {
drawerLabel: 'About Us'
},
},
Page3: {
screen: LogoutScreen,
navigationOptions: {
drawerLabel: 'Logout'
},
}
},
{
initialRouteName: 'Page1',
contentOptions: {
activeTintColor: 'rgb(234, 94, 32)'
}
});
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments