进入navigation后隐藏tabbar

·  阅读 1170
const Stacks = [HomeStackNavigator, ConsoleStackNavigator, CloudStackNavigator, UserStackNavigator]
Stacks.forEach((item) => {
  item.navigationOptions = ({ navigation }) => {
    let tabBarVisible = true
    if (navigation.state.index > 0) {
      tabBarVisible = false
    }
    return {
      tabBarVisible,
    }
  }
});

const TabNavigator = createBottomTabNavigator({
  科技云: HomeStackNavigator,
  控制台: ConsoleStackNavigator,
  云: CloudStackNavigator,
  我的: UserStackNavigator,
},{
  defaultNavigationOptions: ({ navigation }) => ({
    tabBarVisible: Stacks.forEach
  }),
 })
复制代码
分类:
iOS
标签:
收藏成功!
已添加到「」, 点击更改