New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render Drawer on top of menu #76
Comments
In the examples the drawer renders on top of everything. |
@Steviey You should be able to put the DrawerNavigator inside a StackNavigator (similar to my example). The StackNavigator will render a header and the drawer will render underneath it. const MainNavigator = DrawerNavigator({
Dashboard: { screen: Scenes.Dashboard },
Log: { screen: Scenes.Log },
}, {
initialRouteName: 'Dashboard',
});
const AppNavigator = StackNavigator({
Main: { screen: MainNavigator },
}, {
initialRouteName: 'Main',
}); |
It would be nice if const MainNavigator: any = DrawerNavigator({
Dashboard: { screen: Scenes.Dashboard },
Log: { screen: Scenes.Log },
}, {
initialRouteName: 'Dashboard',
});
const PagesNavigator: any = StackNavigator({
Login: { screen: Scenes.Login },
Password: { screen: Scenes.Password },
}, {
initialRouteName: 'Login',
});
const AppNavigator: any = StackNavigator({
Drawer: { screen: MainNavigator },
Pages: { screen: PagesNavigator },
}, {
initialRouteName: 'Drawer',
headerMode: 'none',
}); |
I'm totally new to this project, only have seen the examples. During the last days I was busy to provide some install scripts. Could you provide boilerplate code to see it in action? |
Okay, I've got an insanely ugly hack going here, but it does render a header for the DrawerNavigator which the DrawerLayout slides over top of. I created a custom navigator that renders a However, the |
This is just what I was looking for. @chrissm79 do you have any code we could try? :) |
@nonameolsson I was able to get this to work by wrapping my Drawer screens with a const MainNavigator: any = DrawerNavigator({
// I created a helper function to generate these single stack navigators
// to reduce boilerplate but this is what it produced
Dashboard: {
screen: StackNavigator({
Index: { screen: Scenes.Dashboard }
})
},
Log: {
screen: StackNavigator({
Index: { screen: Scenes.Log }
})
},
}, {
initialRouteName: 'Dashboard',
});
const PagesNavigator: any = StackNavigator({
Login: { screen: Scenes.Login },
Password: { screen: Scenes.Password },
}, {
initialRouteName: 'Login',
});
const AppNavigator: any = StackNavigator({
Drawer: { screen: MainNavigator },
Pages: { screen: PagesNavigator },
}, {
initialRouteName: 'Drawer',
headerMode: 'none',
}); I did, however, have some weird flickering when changing routes, and I had some issues with trying to navigate out of a nested view (in this example, going from the nested |
It would be nice if we could optionally (or by default) render the drawer on top of the header rather than underneath it if the
DrawerNavigator
is nested. Let's say I have the following routes:Currently, the problem is if you are on the Dashboard screen, the drawer opens up underneath the header. It's acceptable for most routes, but I have some screens that render a transparent header and it looks odd when the drawer renders underneath it.
Thanks!
The text was updated successfully, but these errors were encountered: