反应导航5不能在底部标签(例如材料底部标签)中使用移动模式

时间:2020-08-04 08:29:14

标签: react-native react-navigation-v5

我想在我的APP中自定义标签导航,我只需要显示活动标签的标签,我不能使用像材质底部标签那样的平移属性,因为我正在使用@ react-navigation / bottom-tabs。< / p>

function ButtomTabs() {
  return (
    <Tab.Navigator
      initialRouteName="Home"
      activeColor={COLORS.ACTIVETAB}
      inactiveColor={COLORS.INACTIVETAB}
      barStyle={{backgroundColor: COLORS.DEFAULT}}
      backBehavior="initialRoute"
      lazy
      shifting
      tabBarOptions={{
        activeTintColor: COLORS.ACTIVETAB,
        inactiveTintColor: COLORS.INACTIVETAB,
        labelPosition: 'beside-icon',
      }}>
      <Tab.Screen
        name="Home"
        component={HomeStackScreen}
        options={{
          tabBarLabel: 'Accueil',
          tabBarColor: COLORS.DEFAULT,
          tabBarIcon: ({color}) => <MaterialCommunityIcons name="home" color={color} size={26} />,
        }}
      />
      <Tab.Screen
        name="Contacts"
        component={ContactStackScreen}
        options={{
          tabBarLabel: 'Contacts',
          tabBarColor: COLORS.DEFAULT,
          tabBarIcon: ({color}) => (
            <MaterialCommunityIcons name="contacts" color={color} size={26} />
          ),
        }}
      />

0 个答案:

没有答案