嘿,我正在尝试打开抽屉,但是它不起作用。它甚至没有显示任何错误。在过去的1天中,我一直处于这种状态,我找不到任何解决方案,请帮助我..:这是我的代码:
CategoriesScreen.navigationOptions = navData => {
return {
headerTitle: "Meal Categories",
drawerLockMode: "unlocked",
headerLeft: (
<HeaderButtons HeaderButtonComponent={HeaderButton}>
<Item
title="Menu"
iconName="ios-menu"
onPress={() => {
navData.navigation.dispatch(DrawerActions.openDrawer());
}}
/>
</HeaderButtons>
)
};
};
我正在使用:
"react-navigation": "^4.0.10",
"react-navigation-drawer": "^2.3.3",
您为什么在代码中添加drawerLockMode: "unlocked"
?请删除该行。https://facebook.github.io/react-native/docs/drawerlayoutandroid.html#drawerlockmode