如何在反应导航 v5 中让抽屉超过 header?

how to get drawer over header in react navigation v5?

这是我的代码

export const DrawerStack = () => {
  return (
<Drawer.Navigator
      drawerStyle={{backgroundColor: BLUE_COLOR_1}}
      drawerContentOptions={{labelStyle: {color: '#FFF'}}}>
      <Drawer.Screen
        name={HOME_SCREEN}
        component={HomeTopTabNavigator}

      />
      <Drawer.Screen
        name={WALLET}
        component={Wallet}
        options={{title: 'Wallet'}}
      />...

然后我在我包裹在堆栈导航器中的堆栈屏幕中引用它

<Stack.Navigator><Stack.Screen
        name={HOME_STACK_SCREEN}
        component={DrawerStack}

我试过 但这些很快将无法在 v5 中使用,因为导航器不能直接使用另一个导航器 child

你需要把你的堆栈放在抽屉里而不是抽屉里堆栈

- Drawer
  - Stack
    - Home
    - Wallet

https://reactnavigation.org/docs/en/nesting-navigators.html#parent-navigators-ui-is-rendered-on-top-of-child-navigator

v5 as navigator can't have another navigator as direct child

您不需要直系子代。将堆栈放在屏幕内。