0

我正在使用 react-navigation 3 版本和 react native 0.59 版本。我正在为登录代码使用切换导航。一旦我登录,它就会重定向到主屏幕,并且从主屏幕进行其他导航工作正常,但抽屉图标不显示。

我的 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)
4

1 回答 1

2

因为你可以通过向右滑动来打开抽屉,如果你想用一个图标打开它,你必须制作一个标题组件并在你想要的屏幕上使用它。这是一个很好的标题示例:https ://react-native-training.github.io/react-native-elements/docs/header.html

于 2019-05-06T11:25:26.957 回答