简体   繁体   中英

react native navigation3 I want to hide one label of bottom tab navigation

在此处输入图片说明

I want to hide the label which is highlighted in yellow in the picture.

How to do that?

My code:

const MainBottomTab = createBottomTabNavigator({
  HomeStack : {
    screen : HomeStack,
    navigationOptions : {
      showlabel:false,
      drawerLabel:NullComponent
    }
  } ,
  SettingsStack,
  },{
  tabBarPosition:"bottom",
  navigationOptions:{

  },
  tabBarOptions:{

activeTintColor: "green",
inactiveTintColor: "#00ccff",
style:{
  backgroundColor: "white"
},
indicatorStyle:{
  height: 0
},
showIcon:'true'


},
 swipeEnabled:true,
});

use custom TabIcon

 navigationOptions :({ navigation }) {
  tabBarIcon: ({ tintColor }) => {

    const { routeName } = navigation.state;
    let iconName;
    if (routeName === 'Home') iconName = 'home';
    else if (routeName === 'Notifications') iconName = 'notifications';
    else if (routeName === 'Readout') iconName = 'readout';
    else if (routeName === 'Inbox') iconName = 'messages';
    else if (routeName === 'Profile') iconName = 'profile';
 //Tabicon is just custom Icon display widget . handle All tabicon in TabIcon by iconname 
     return <TabIcons iconName={iconName} tintColor={tintColor} />;

 }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM