React Native React Navigation DrawerNavigator用于特定视图

时间:2017-06-29 04:51:25

标签: android ios react-native react-navigation

我尝试设置和使用DrawerNavigator,但只有在用户登录后才会显示在我的视图中。例如,不会显示在登录视图或请求密码视图中。

我有以下DrawerNavigator

// Drawer Navigation
export const MainDrawerNavigator = DrawerNavigator({
    Home: {
        screen: Home,
        navigationOptions: {
            drawer:{
                label: "Home",
            }
        },
    },
    Logout: {
        screen: Logout,
        navigationOptions: {
            drawer:{
                label: "Logout",
            }
        },
    }
});

然后我的主要导航

// Main navigation StackNavigator
export const MainScreenNavigator = StackNavigator({
    Login: {
        screen: Login,
        navigationOptions: {
            title: "Login",
            headerLeft: null
        },
    },
    ResetPassword: {
        screen: ResetPassword,
        navigationOptions: {
            title: "Reset Password",
            headerLeft: null
        },
    },
    Home: {
        screen: TabsNavigation,
        navigationOptions: {
            title: "Home",
            headerLeft: null,
        }
    }
});

我的索引文件

class App extends Component {
    render() {
        return <MainScreenNavigator />
    }
}

export default App;

如何渲染抽屉导航?我怎么做只有特定的观点

0 个答案:

没有答案