我正在使用带有本机0.59版本的react-navigation 3版本。 我正在使用开关导航作为登录代码。登录后,它将重定向到主屏幕,并且从主屏幕进行的其他导航工作正常,但抽屉图标未显示。
我的navigator.js
export const AppStack = createStackNavigator({
Home: {
screen: HomeScreen,
navigationOptions: {
headerRight:soundicon()
}
},
withdraw: {
screen: WithdrawScreen,
navigationOptions: {
headerRight:soundicon()
}
},
deposite: {
screen: DepositScreen,
navigationOptions: {
headerRight:soundicon()
}
},
money: {
screen: MoneyScreen,
navigationOptions: {
headerRight:soundicon()
}
}
});
export const drawermenu = createDrawerNavigator({
Home: AppStack,
})
export const AuthStack = createStackNavigator({
SignIn: {
screen: SignInScreen,
navigationOptions: {
header: null,
}
},
Signup: {
screen: SignupScreen,
navigationOptions: {
}
},
ForgotPassword: {
screen: ForgotPasswordScreen,
navigationOptions: {
}
}
});
export const AppNavigator = createSwitchNavigator(
{
AuthLoading: AuthLoadingScreen,
App: drawermenu,
Auth: AuthStack,
},
{
initialRouteName: 'AuthLoading',
});
export const AppNavigatorObj = createAppContainer(AppNavigator)
答案 0 :(得分:2)
现在可以通过向右滑动来打开抽屉,如果要使用图标打开它,则必须制作一个标题组件并在所需的屏幕上使用它。这是标题的一个好例子:https://react-native-training.github.io/react-native-elements/docs/header.html