这是我的tabNav,我正在尝试加载HomeStackNav,但是当我这样做时,我的主屏幕组件下面有标签。
const TabNav = TabNavigator({
HomeScreen: {screen: HomeStackNav},
Dashboard: { screen: DashboardStackNav },
Add: {screen: AddStackNav},
Profile: { screen: ProfileStackNav },
}, {
tabBarPosition: 'bottom',
tabBarOptions: {
activeTintColor: 'salmon',
activeBackgroundColor: '#c0c1c4',
inactiveTintColor: '#f4af55',
inactiveBackgroundColor: 'white',
labelOptions: {
fontSize: 10,
fontWeight: 'bold'
},
}
})
我尝试在此处和主屏幕组件中实现导航选项以隐藏选项卡,但没有成功。
const HomeStackNav = StackNavigator({
HomeScreen: {
screen: HomeScreen
},
Dashboard: {
screen: Dashboard
}
},
{
initialRouteName: 'HomeScreen',
navigationOptions: {
header: null,
tabBarVisible: false
}
})
export default HomeStackNav;
答案 0 :(得分:0)
尝试
navigationOptions: {
tabBarVisible: false
}
作为TabNavigator
HomeScreen: {screen: HomeStackNav}
所以
HomeScreen: {
screen: HomeStackNav,
navigationOptions: {
tabBarVisible: false
}
}
正如您所指的根导航。