Javascript 如何隐藏一个;特定选项卡栏项目";使用时从底部选项卡栏:@react导航/底部选项卡
这是一个视频,展示了我当前所有可见的底部选项卡项:主页、我的帐户、购物车和菜单 我想在屏幕上呈现其他底部选项卡项,但在底部选项卡栏本身中不可见。(例如:SettingsView)Javascript 如何隐藏一个;特定选项卡栏项目";使用时从底部选项卡栏:@react导航/底部选项卡,javascript,reactjs,react-native,Javascript,Reactjs,React Native,这是一个视频,展示了我当前所有可见的底部选项卡项:主页、我的帐户、购物车和菜单 我想在屏幕上呈现其他底部选项卡项,但在底部选项卡栏本身中不可见。(例如:SettingsView) 如何使用react native navigation v5实现这一点?我已经解决了自己的问题: <Tab.Navigator tabBarOptions={{ activeTintColor: '#161718', inactiveTintColor: '#ffffff', styl
如何使用react native navigation v5实现这一点?我已经解决了自己的问题:
<Tab.Navigator
tabBarOptions={{
activeTintColor: '#161718',
inactiveTintColor: '#ffffff',
style: {
backgroundColor: '#161718',
paddingTop: 10,
borderTopColor: '#161718',
},
labelStyle: {
textAlign: 'center',
top: 8,
},
}}
screenOptions={({route}) => ({
tabBarButton: ['Contact', 'Route2ToExclude'].includes(route.name)
? () => {
return null;
}
: undefined,
})}>
({
选项卡按钮:['Contact','Route2ToExclude']。包括(route.name)
? () => {
返回null;
}
:未定义,
})}>
如您所见,我正在使用screenoptions定义要从底部选项卡栏中排除的路线。注意:这些路由确实需要是组件内的实际屏幕