抽屉菜单消失/不显示

时间:2019-06-16 13:05:27

标签: react-native-navigation

我已经将本机expo版本27升级到了32。还必须升级react-navigation。结果导致抽屉菜单消失了。我是本机的新手。

const HomeNavigator = createStackNavigator(
  {
    HomeScreen: {
      screen: HomeScreen,
      navigationOptions: ({ navigation }) => ({
        headerLeft: leftIcon(navigation, "md-menu")
      })
    },
    WorkoutsScreen: {
      screen: WorkoutsScreen
    },
    ExercisesScreen: {
      screen: ExercisesScreen
    },
    CalendarScreen: {
      screen: CalendarScreen
    },
    DietsScreen: {
      screen: DietsScreen
    },
    PostsScreen: {
      screen: PostsScreen
    },
    TeamsScreen: {
      screen: TeamsScreen
    },
    EBodypartsScreen: {
      screen: EBodypartsScreen
    },
    EquipmentsScreen: {
      screen: EquipmentsScreen
    },
    ExercisesByMuscleScreen: {
      screen: ExercisesByMuscleScreen
    },
    ExercisesByEquipmentScreen: {
      screen: ExercisesByEquipmentScreen
    },
    WorkoutsByGoalScreen: {
      screen: WorkoutsByGoalScreen
    },
    WorkoutsByLevelScreen: {
      screen: WorkoutsByLevelScreen
    },
    PostsByTagScreen: {
      screen: PostsByTagScreen
    },
    DietsByCategoryScreen: {
      screen: DietsByCategoryScreen
    },
    TagsScreen: {
      screen: TagsScreen
    },
    CategoriesScreen: {
      screen: CategoriesScreen
    },
    WGoalsScreen: {
      screen: WGoalsScreen
    },
    WLevelsScreen: {
      screen: WLevelsScreen
    },
    Day1Screen: {
      screen: Day1Screen
    },
    Day2Screen: {
      screen: Day2Screen
    },
    Day3Screen: {
      screen: Day3Screen
    },
    Day4Screen: {
      screen: Day4Screen
    },
    Day5Screen: {
      screen: Day5Screen
    },
    Day6Screen: {
      screen: Day6Screen
    },
    Day7Screen: {
      screen: Day7Screen
    },
    WorkoutDetailsScreen: {
      screen: WorkoutDetailsScreen
    },
    VideoExerciseScreen: {
      screen: VideoExerciseScreen
    },
    ExerciseDetailsScreen: {
      screen: ExerciseDetailsScreen
    },
    DietDetailsScreen: {
      screen: DietDetailsScreen
    },
    PostDetailsScreen: {
      screen: PostDetailsScreen
    },
    TeamDetailsScreen: {
      screen: TeamDetailsScreen
    },
    ProfileScreen: {
      screen: ProfileScreen
    },
    LogoutScreen: {
      screen: LogoutScreen
    },
    WorkoutSearchScreen: {
      screen: WorkoutSearchScreen
    },
    WorkoutResultsScreen: {
      screen: WorkoutResultsScreen
    },
    CalculatorScreen: {
      screen: CalculatorScreen
    },
    QuotesScreen: {
      screen: QuotesScreen
    },
    SettingsScreen: {
      screen: SettingsScreen
    },
    AboutUsScreen: {
      screen: AboutUsScreen
    },
    TermsScreen: {
      screen: TermsScreen
    },
    ContactUsScreen: {
      screen: ContactUsScreen
    },
    ExercisesByWorkoutsScreen: {
      screen: ExercisesByWorkoutsScreen
    }
  },
  navigationOptions
);
//this is changed
const MainNavigator = createDrawerNavigator(
  {
    Home: {
      screen: HomeNavigator
    }
  },
  {
    contentComponent: SideMenu,
    drawerWidth: width * 0.7,
    drawerOpenRoute: "DrawerOpen",
    drawerCloseRoute: "DrawerClose",
    drawerToggleRoute: "DrawerToggle"
  }
);
// 
//this is changed
const Apps = createAppContainer(MainNavigator);

//export default createAppContainer(MainNavigator);

 //export default App;
export default class App extends React.Component {
  render() {
      return <Apps />;

  }
}

}

升级后我更改的某些行会反应导航。就像将stacknavigator导入到createstacknavigator中一样。我有expo SDK版本27,已升级到32,并且根据新库要求对代码进行了一些更改。任何人都可以在代码中帮助我了解为什么抽屉菜单消失了吗?

0 个答案:

没有答案