我有一个bottomTabNavigator,看起来像这样。

const tabNavigator = createBottomTabNavigator({ [SCREEN1]: { screen: StackNavigator1 }, [SCREEN2]: { screen: StackNavigator2 }, [SCREEN3]: { screen: SplashScreen },},

现在,如何在每个屏幕上创建一个DrawerNavigator?在普通屏幕上创建非常简单。如何在stackNavigator中创建它?

最佳答案

它非常简单。您将DrawerNavigator设置为屏幕组件。
例如:

const dn1 = createDrawerNavigator({
   [Screen1]: {
       screen: Screen01
   }
});

const dn2= createDrawerNavigator({
    [Screen1]: {
        screen: Screen02
    }
 });

 const dn3 = createDrawerNavigator({
    [Screen1]: {
        screen: Screen03
    }
 });

const tabNavigator = createBottomTabNavigator({
    [SCREEN1]: {
        screen: dn1
    },
    [SCREEN2]: {
        screen: dn2
    },
    [SCREEN3]: {
        screen: dn3
    },
}


这样,您将为每个选项卡使用单独的DrawerNavigator。

09-10 07:36