抽屉没有关闭

时间:2018-06-11 19:01:23

标签: react-native react-native-android react-native-navigation

我正在尝试将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);
    //   }}/>

  });

0 个答案:

没有答案