change active menu icon color in DrawerNagivation react-native

Mahi Parmar

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
});
Dinith Minura

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Change the color of menu icon

From Dev

Change active and inactive icon color

From Dev

Change menu navigation icon color in xml for Android

From Dev

Change menu navigation icon color in xml for Android

From Dev

change menu color item when active

From Dev

How to change the color of the active link in the menu

From Dev

How to change font-awesome icon color when it is active

From Dev

How to change font-awesome icon color when it is active

From Dev

background color on active icon?

From Dev

Change the pull down icon for React Native Calendars

From Dev

change color of only ONE menu item icon in android

From Dev

How to change React Native cursor color?

From Dev

Change react-native rootView color to black?

From Dev

React Native Change Color Every Second

From Dev

How to invert react native vector icon buttons color?

From Dev

Instant icon color change

From Dev

Icon Color in Android Slide Menu

From Dev

How change active tab color in React material-ui?

From Dev

Bootstrap active menu bar color

From Dev

How to make .icon-bar and .navbar-toggle's border change color when active?

From Dev

How to make .icon-bar and .navbar-toggle's border change color when active?

From Dev

How to change color of text and icon of Sub-Menu attached to Navigation view?

From Dev

Android change actionBar icon menu

From Dev

change icon on menu link click

From Dev

Change the Arrow Icon in the Drawer Menu?

From Dev

Change icon on MATE main menu

From Java

Can't change color of Card Title text in React Native Paper

From Java

How to change to color of react-native-tab-view?

From Dev

Change Button Color onPress (toggle functionality) React Native

Related Related

HotTag

Archive