我正在尝试将stackNavigator与drawerNavigator一起使用并遇到问题。也就是说,当它打开时我无法关闭抽屉......就像closeDrawer
动作一样。任何想法如何解决这个问题?我已经在2天内挣扎着筑巢......感谢任何帮助
const StackNav = createStackNavigator(
{
Home: { screen: HomeScreen },
ScanCode: { screen: ScanCodeModal },
ScanResult: { screen: ScanResultScreen },
}, {
headerMode: 'none'
});
const Navigator = createDrawerNavigator(
{
SignInScreen: { screen: SignInScreen },
Main: {
screen: StackNav, navigationOptions: {
drawerLabel: () => null
}
},
Home: { screen: HomeScreen },
ScanCode: { screen: ScanCodeModal }
}, {
initialRouteName: 'SignInScreen',
// contentComponent: (props) =>
// <DrawerItems {...props} onItemPress={({ route, focused }) => {
//
// const { navigate } = props.navigation;
// console.log(props)
// props.navigation.dispatch( NavigationActions.navigate({ routeName: 'DrawerClose' }) );
// navigate(route.routeName);
// }}/>
});