react-navigation=3.0版本

Author Avatar
Weining Dec 18, 2018

App.js

import { createBottomTabNavigator, createStackNavigator,createAppContainer } from 'react-navigation';import HomePage from './page/HomePage';import MinePage from './page/MinePage';import ProfilePage from './page/ProfilePage';import TabNavigator from './navigators/AppNavigators';export const AppStackNavigator = createStackNavigator({ TabNavigator:TabNavigator, HomePage:HomePage, MinePage: MinePage, ProfilePage:ProfilePage,},{ headerMode:"none"});export default createAppContainer(AppStackNavigator);

AppNavigators.js

import { createBottomTabNavigator, createStackNavigator,createAppContainer } from 'react-navigation';import HomePage from '../page/HomePage';import MinePage from '../page/MinePage';const TabNavigator = createBottomTabNavigator({ HomePage: HomePage, MinePage: MinePage,},{ tabBarOptions:{ activeTintColor: '#e91e63', tabBarIcon:{ height:(10), }, labelStyle:{ fontSize:(14), margin:(6) }, style:{ height:(70) } }});export default createAppContainer(TabNavigator);