如何在React Native中隐藏特定的Tab组件?

时间:2019-01-16 13:24:09

标签: reactjs react-native react-navigation stack-navigator react-native-tabnavigator

在我的代码中,我想在Tabnavigator中隐藏“抽屉”选项卡。 我会做很多尝试,但不能正常工作。请帮助我。

const Drawer=createDrawerNavigator({
Home:{screen:Home},

})
const TabNavigator = createBottomTabNavigator({
Drawer:{screen:Drawer},
Home: {screen: Home},
Categories:{screen:Cate},
ShortList:{screen:ShortList},
Account:{screen:Account},
},
}
);

1 个答案:

答案 0 :(得分:0)

不能。您可以将pu内的选项卡pu起来,这样就可以隐藏抽屉,但在所有选项卡上都可以使用

const Drawer=createDrawerNavigator({
Tabs:{screen:TabNavigator, navigationOptions: {drawerLabel: () => null}}
Home:{screen:Home}

})
const TabNavigator = createBottomTabNavigator({
Home: {screen: Home},
Categories:{screen:Cate},
ShortList:{screen:ShortList},
Account:{screen:Account},
},
}
);