反应导航5-从左到右移动抽屉项目图标

问题描述 投票:0回答:1

我想在左侧显示标签,在右侧显示抽屉图标,但无法弄清楚如何。这是代码

<Drawer.Navigator
      drawerContentOptions={{
        contentContainerStyle: {
          backgroundColor: Colors.primary,
          height: "100%"
        },
        labelStyle: { color: "white" }
      }}
    >
      <Drawer.Screen
        name="HomeScreen"
        component={Home}
        options={{ drawerLabel: "Home" }}
      />
      <Drawer.Screen
        name="Channels"
        component={Channels}
        options={{
          drawerIcon: () => (
            <AntDesign
              name="pluscircle"
              size={20}
              color="white"
            />
          )
        }}
      />
    </Drawer.Navigator>

我想在左侧显示“频道”,在右侧显示加号图标

react-native react-navigation react-navigation-drawer
1个回答
0
投票

尝试使用headerLeftheaderRight

 headerLeft: () => (
      <Icon
        style={{padding: 10}}
        onPress={() => {
            consol.log("on press}}
        color={'white'}
        name="menu"
        size={30}
      />
© www.soinside.com 2019 - 2024. All rights reserved.