RN:在特定的屏幕隐藏标签栏

基于 react navigation,安装的依赖有:

"@react-navigation/bottom-tabs": "^6.3.1",
"@react-navigation/native": "^6.0.10",
"@react-navigation/native-stack": "^6.6.1",

最简单的方法是将 Tab.Navigator 嵌套在 Stack.Navigator 的第一个屏幕中。

import * as React from 'react';
import { Text, View, Button } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

function Demo({ navigation }) {
  return (
    
      

参考

Hiding tab bar in specific screens

你可能感兴趣的:(RN:在特定的屏幕隐藏标签栏)