//index.js

    1. import { createAppContainer, createSwitchNavigator } from 'react-navigation';
    2. import { createStackNavigator } from 'react-navigation-stack';
    3. import welcomePage from '../views/welcomePage';
    4. import Tabs from './tabs'
    5. import DetailPage from '../views/DetailPage';
    6. const InitNavigator = createStackNavigator({
    7. WelCome:{
    8. screen:welcomePage,
    9. navigationOptions:{
    10. header:null
    11. }
    12. }
    13. })
    14. const MainNavigator = createStackNavigator({
    15. HomePage:{
    16. screen:Tabs //底部导航路由 配置参考底部导航笔记
    17. }
    18. })
    19. const router = createSwitchNavigator({
    20. Init:InitNavigator,
    21. Main:MainNavigator
    22. },{
    23. initialRouteName:'Init' //先显示
    24. })
    25. export default createAppContainer(router)