首页 > 解决方案 > 侧边菜单反应原生

问题描述

所以基本上我在 react native 中使用导航。我在主标题的每一侧都有两个图标,我想为两者创建抽屉,但似乎你不能使用 openDrawer() 打开一个特定的抽屉。除了导航抽屉之外,还有其他替代方法可以使用 expo 创建侧边菜单吗?

export const CategoriesDrawerNavigation = () => (
    <Drawer.Navigator initialRouteName='all' drawerContentOptions={{
        activeBackgroundColor: Colors.selectedColor,
        activeTintColor: 'black'
    }}>
        <Drawer.Screen name='all' component={ProductStackNavigation}/>
        {CategoriesList.map((item, i) =>(
        <Drawer.Screen name={item} key={i} component={ProductCategoriesStackNavigation}/>
        ))}
    </Drawer.Navigator>
)

export const FilterDrawerNavigation = () => (
    <Drawer.Navigator initialRouteName='all' drawerContentOptions={{
        activeBackgroundColor: Colors.selectedColor,
        activeTintColor: 'black'
    }}>
        <Drawer.Screen name='filters' component={ProductStackNavigation} options={{
            title: ''
        }}/>
    </Drawer.Navigator>
)

标签: reactjsreact-native

解决方案


推荐阅读