安装
yarn add @react-navigation/bottom-tabs
基础的 Tab
import * as React from 'react';
import { Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
function HomeScreen() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>这里是首页</Text>
</View>
);
}
function SettingsScreen() {
...