React Navigation V5 Hide Bottom Tabs

后端 未结 8 1451
轻奢々
轻奢々 2021-01-05 06:35

I would like to be able to hide the tabs on a screen using React Native Navigation v5.

I\'ve been reading the documentation but it doesn\'t seem like they\'ve update

8条回答
  •  隐瞒了意图╮
    2021-01-05 07:03

    You will have to restructure your navigation by having your Tab Navigator nested in the Stack Navigator. Following the details here hiding-tabbar-in-screens

    This way it's still also possible to have a Stack Navigator nested in yourTab Navigator. SettingsStack

    With this when the user is on the Setting screen and also the Update detail screen, the tab bar is visible but on the Profile screen, the tab bar is not.

    import Home from './components/Home';
    import Settings from './components/Settings';
    import UpdateDetails from './components/UpdateDetails';
    import Profile from './components/Profile';
    
    import * as React from 'react';
    import { NavigationContainer } from '@react-navigation/native';
    import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
    import { createStackNavigator } from '@react-navigation/stack';
    
    const Stack = createStackNavigator();
    const StackSettings = createStackNavigator();
    const Tab = createBottomTabNavigator();
    
    function SettingsStack() {
        return (
            
                
                
            
        )
    }
    
    function HomeTabs() {
      return (
        
          
          
        
      );
    }
    
    
    export default function App() {
      return (
        
          
            
            
          
        
      );
    }
    

提交回复
热议问题