嗨朋友们,我在过去 2 天的反应导航中摸不着头脑,我尝试了很多东西(对于初学者来说,文档似乎不太清楚),所以现在我面临的问题对我来说似乎并不复杂,因此我寻求建议和帮助以继续进行。以下是我寻求帮助的案例/问题/场景 -
我使用以下代码块来达到这一点
import React, {Component} from 'react';
import { AppRegistry, View, BackAndroid, StatusBar,} from 'react-native';
import {
NavigationActions,
addNavigationHelpers,
StackNavigator,
DrawerNavigator
} from 'react-navigation';
import LandingScreen from 'src/screens/landingScreen';
import Login from 'src/screens/login'
import SignUp from 'src/screens/signUp'
import ForgotPassword from 'src/screens/forgotPassword'
import Dashboard from 'src/screens/dashboard'
import UserProfile from 'src/screens/userProfile'
export const Drawer = DrawerNavigator({
Dashboard:{
path:'/',
screen:Dashboard,
},
UserProfile:{
path:'/'
screen:UserProfile
},
}, {
initialRouteName: 'Dashboard',
contentOptions: {
activeTintColor: '#e91e63',
},
headerMode: 'screen',
});
const routesConfig = {
Landing:{screen:LandingScreen},
Login: { screen: Login },
SignUp: { screen: SignUp },
ForgotPassword: { screen: ForgotPassword },
Drawer:{screen:Drawer}
};
export const AppNavigator = StackNavigator(routesConfig, {
initialRouteName: 'Drawer'
});
AppRegistry.registerComponent('Riduk', () => AppNavigator);
- 另一个问题是我应该如何在同一个屏幕上在我的应用程序中添加 2 个抽屉