官方文档:
https://reactnavigation.org/docs/zh-Hans/2.x/getting-started.html
效果图:
项目结构:
安装模块:
cd 到项目目录下
yarn add react-navigation@2.18.3
源代码:
BottomIndex 配置路由,Home1,Home2,Home3分别是一个页面
BottomIndex 代码:
import React from 'react';
import {Text, View, Image} from 'react-native';
import {StackNavigator, createBottomTabNavigator, createStackNavigator} from 'react-navigation';
import Home1 from './Home1';
import Home2 from './Home2';
import Home3 from "./Home3";
export default createBottomTabNavigator(
{