创建两个DrawerNavigator

时间:2017-10-24 13:22:32

标签: react-native react-navigation

请我想在1 stacknavigator中创建两个DrawerNavigator我需要第一个将在菜单抽屉中,第二个将是购物车项目我需要一些帮助或只是一些想法如何创建这与反应导航谢谢 这是我的实际实现

const RootNavigator =     StackNavigator({

    Drawer: {
        screen: DrawerNavigator(
            DrawerRoutesLeft,DrawerContentLeft
        )
    },
        ...AnonymousStack
    },
    { headerMode: 'none' }
);



let drawerStack = {
    Home: {screen: nav_tab},
    Rayon: {title:"Rayon" ,screen: Rayon},
    Product : {screen :Porduct } }


export let DrawerContentLeft = {
    drawerWidth: DEVICE_WIDTH - DEVICE_WIDTH / 5,
    contentOptions: {
        inactiveTintColor: '#333',
        activeTintColor: "#ddd0dd",
    },
    contentComponent: DrawerContent,
    drawerPosition: 'left',

}

let drawerOptions =  {
    navigationOptions:({navigation}) => ({
        headerLeft: <MenuButton navigate={navigation.navigate}/>,
        headerStyle:styles.header
    }) }


export let DrawerRoutesLeft = {
    Home: {
        screen: StackNavigator(drawerStack, drawerOptions)
    },
    Product: {
        screen: StackNavigator(drawerStack)
    } }

0 个答案:

没有答案