我目前有这种结构:
const Tabs = TabNavigator({
Home: {screen: Home},
Store:{screen: Store}
More: {screen: More,
navigationOptions: {
tabBarLabel: 'More',
tabBarIcon: <Entypo name='dots-three-horizontal' size={25}/>,
header: null
},
}
},
{
initialRouteName: 'Home',
tabBarPosition: 'bottom',
navigationOptions: ({ navigation }) => ({
tabBarOnPress: (scene, jumpToIndex) => {
if (scene.route.routeName === "More") {
navigation.navigate('DrawerToggle')
}
else{
jumpToIndex(scene.index);
}
},
}),
},
)
const Drawer = DrawerNavigator(
{
Tabs: {screen: Tabs,
navigationOptions: {
drawerLabel: () => null
}
},
Profile: {screen: Profile},
Search: {screen: Search}
},
{
initialRouteName: 'Tabs',
headerMode: 'none',
drawerPosition: 'right'
}
)
export const Root = StackNavigator(
{
LoginScreen: {screen: Login},
Drawer: {screen: Drawer},
},
{
initialRouteName: 'LoginScreen'
}
)
Stacknavigator - > DrawerNavigator - > Tabnavigator .
LoginScreen导航到Drawer Navigator(初始路由是Tabnavigator屏幕) . 当按Tabbar抽屉菜单中的更多按钮时,会显示配置文件和搜索屏幕 . 问题是我在这些屏幕中没有Tabbar(配置文件和搜索) . 我想在应用程序的每个屏幕上都有Tabbar,以便用户可以轻松导航到Tabbar屏幕 .
我想要实现的功能是我想在'Profile'和'Search'页面(DrawerNavigator屏幕)中显示TabBar . 怎么可能?