组合底部导航器和顶部导航器

时间:2019-10-17 11:48:32

标签: react-native react-navigation

AppNavigator和TopBarNavigator应该一直显示在应用程序上。问题是如果不将topbarnav添加到appNavigator中就无法显示它。这样做的问题是它添加了一个额外的选项卡,我不想在底部显示该选项卡。

const AppNavigator = createBottomTabNavigator(
    {
      Insights: {screen: Insights},

      Incidents: {screen: googleMapsImages},

      Plus: {screen: Addhazard},

      'Team alerts': {screen: TeamAlerts},

      More: {screen: Main},
    },{
    tabBarOptions: {
      activeTintColor: 'green',
      inactiveTintColor: 'gray',
    },
  }
);

const Drawernavigator = createDrawerNavigator(
  {
    BottomNavigator: {screen: AppNavigator},
    Team: {screen: YourTeam},
  }
);

const AppContainer = createAppContainer(Drawernavigator);
class App extends Component {
  render(){
   return (
          <View style={styles.container}>
            <AppContainer />
          </View>
            );
      }
    }

一个很好的例子是您可以在此处下载的应用程序-> https://safetyculture.com/spotlight/

0 个答案:

没有答案