我在React Native中是一个非常陌生的人,试图在抽屉中添加一个测试屏幕,但我做不到。
import { createDrawerNavigator, createStackNavigator } from "react-navigation"
/* Some imports here neglected...*/
/*
* icon size
* */
const iconSize = 18
const IntegratedNavigation = createStackNavigator({
bottomNavigator: { screen: BottomNavigator, navigationOptions: { header: null } },
something: { screen: Something, navigationOptions: { header: null } },
something2: { screen: SomethingElse, navigationOptions: { header: null } },
})
export const DrawerNavigator = createDrawerNavigator({
Tabs: {
screen: IntegratedNavigation,
navigationOptions: {
drawerLabel: "Explore",
drawerIcon: ({ tintColor, focused }) => (
<Icon icon={"search"} size={iconSize} color={tintColor}/>
),
header: null,
},
},
PartnersScreen: {
screen: PartnersScreen,
navigationOptions: {
drawerLabel: "Partners",
drawerIcon: ({ tintColor, focused }) => (
<Icon icon={"safety"} size={iconSize} color={tintColor}/>
),
},
},
HelloScreen: {
screen: PartnersScreen, /*This is a testing new drawer tab that never appear!*/
navigationOptions: {
drawerLabel: "Test!",
drawerIcon: ({ tintColor, focused }) => (
<Icon icon={"test"} size={iconSize} color={tintColor}/>
),
},
},
}, {
contentOptions: {
inactiveTintColor: color.palette.lightBlack,
activeTintColor: color.primary,
},
contentComponent: props => (<MenuUserInfo drawerItemsProps={props}/>),
drawerWidth: 240,
},
)
作为测试,我只想将“ PartnersScreen”复制为另一个选项卡。但是新路线从未出现。我不知道需要修改哪个其他文件。有想法吗?