反应本机底部标签导航隐藏组件主页

时间:2020-09-02 00:16:58

标签: react-native react-navigation react-navigation-bottom-tab

是否可以从导航栏中隐藏Home组件? 事实是,当我按Home键时,我将返回登录名,这不是主意

这是我的app.js

enter code here

const App =()=> {

const Tab = createBottomTabNavigator();

const Stack = createStackNavigator(); 函数StackScreen(){ 返回(

  <Stack.Navigator 
  screenOptions={{headerStyle:{
    backgroundColor: '#C0292D',
  },
  headerTitleStyle:{
    fontWeight: 'bold',
    alignSelf: 'center',
    color: '#fff',
  },
  headerTintColor: '#ffffff'
}}
>
      <Stack.Screen name="Login" component={Login} options={{title: "", headerShown: false, tabBarVisible: false}}/>
      <Stack.Screen name="Register" component={Register} options={{title: "Registro", headerShown: false, tabBarVisible: false}}/>
      <Stack.Screen name="Menu"
                    component={Menu}
                    options={{
                      title: "Productos",
                      tabBarVisible: false,
                    headerRight: props => <Carrito/>
                    }}/>
      <Stack.Screen name="DetalleProducto" component={DetalleProducto} options={{title: "Detalle del producto", tabBarVisible: false}} />
      <Stack.Screen name="FormularioProducto" component={FormularioProducto} options={{title: "Creando nuestra orden", tabBarVisible: false}} />
      <Stack.Screen name="DetallePedido" component={DetallePedido} options={{title: "Detalle de tu pedido", tabBarVisible: false}} />
      <Stack.Screen name="Celda" component={Celda} options={{title: "Confirmar N° de celda", tabBarVisible: false}} />
      <Stack.Screen name="ProgresoPedido" component={ProgresoPedido} options={{title: "Estado del pedido"}} />
  </Stack.Navigator>
)

} 返回( <>

<FirebaseState>
  <PedidoState>
  <NavigationContainer>
  <Tab.Navigator>
           <Tab.Screen name='home' component={StackScreen} options={{ headerShown: false, tabBarVisible: false, showLabel: false}} />
           <Tab.Screen name="NuevaOrden" component={NuevaOrden} options={{title: "Restaurantes", headerShown: false}}/>
           <Tab.Screen name="Pedidos" component={Pedidos} options={{title: "Pedidos", headerShown: false}}/>
           </Tab.Navigator>
</NavigationContainer>
</PedidoState>
</FirebaseState>
</>

) };

0 个答案:

没有答案