Reactjs 如何在屏幕菜单中将RouteName初始化为createTabBottomNavigator
如何将InitialRouteName初始化为createTabNavigator,在菜单屏幕位置InitialRouteName 这适用于运行到Windows 10的新React本机Reactjs 如何在屏幕菜单中将RouteName初始化为createTabBottomNavigator,reactjs,react-native,react-navigation,Reactjs,React Native,React Navigation,如何将InitialRouteName初始化为createTabNavigator,在菜单屏幕位置InitialRouteName 这适用于运行到Windows 10的新React本机 const MainTabs = createBottomTabNavigator({ Order: { screen: OrderScreen, navigationOptions: { tabBarIcon: ({ tintColor }) =&
const MainTabs = createBottomTabNavigator({
Order: {
screen: OrderScreen,
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
<Icon type = 'AntDesign' name = 'search1' style = {{fontSize: 22, color:`${tintColor}`}} />
),
title: 'Order'
}
},
Payment: {
screen: PaymentScreen,
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
<Icon type = 'AntDesign' name = 'search1' style = {{fontSize: 22, color:`${tintColor}`}} />
),
title: 'Payment'
}
},
Menu: {
screen: MenuScreen,
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
<Icon type = 'AntDesign' name = 'search1' style = {{fontSize: 22, color:`${tintColor}`}} />
),
title: 'Menu'
}
},
Chat: {
screen: ChatScreen,
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
<Icon type = 'AntDesign' name = 'search1' style = {{fontSize: 22, color:`${tintColor}`}} />
),
title: 'Chat'
}
},
Setting: {
screen: SettingScreen,
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
<Icon type = 'AntDesign' name = 'search1' style = {{fontSize: 22, color:`${tintColor}`}} />
),
title: 'Setting'
}
},
},{
tabBarOptions: {
activeTintColor: '#fbda91',
inactiveTintColor: 'white',
activeBackgroundColor: '#fb8691',
inactiveBackgroundColor: '#fb8691',
borderTopWidth: 0,
}
})
const MainTabs=createBottomTabNavigator({
订单:{
屏幕:订单屏幕,
导航选项:{
tabBarIcon:({tintColor})=>(
),
标题:“订单”
}
},
付款:{
屏幕:PaymentScreen,
导航选项:{
tabBarIcon:({tintColor})=>(
),
标题:“付款”
}
},
菜单:{
屏幕:菜单屏幕,
导航选项:{
tabBarIcon:({tintColor})=>(
),
标题:“菜单”
}
},
聊天:{
屏幕:聊天屏幕,
导航选项:{
tabBarIcon:({tintColor})=>(
),
标题:“聊天”
}
},
设置:{
屏幕:设置屏幕,
导航选项:{
tabBarIcon:({tintColor})=>(
),
标题:“设置”
}
},
},{
选项卡选项:{
activeTintColor:“#fbda91”,
不显示颜色:“白色”,
activeBackgroundColor:“#fb8691”,
inactiveBackgroundColor:“#fb8691”,
borderTopWidth:0,
}
})
I除了InitialRouteName命令的输出根据更改为菜单外,您可以使用该方法的第二个参数设置一些配置,它具有InitialRouteName
,您可以根据需要将其设置为菜单,如下所示:
const MainTabs = createBottomTabNavigator(
{/* your routes*/},
{initialRouteName: "Menu"}, // <-- you should pass this config object to the method
);
const MainTabs=createBottomTabNavigator(
{/*您的路线*/},
{initialRouteName:“菜单”},//愉快导航:)