本文介绍了TabBar位于React Native的StackNavigation中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我将使用 StackNavigation 及其参数进行推送和弹出.它的工作正常.但是现在我想在StackNavigation之后的一些屏幕TabBar之后实现,对在StackNavigation之后如何获取TabBar有任何想法.

I will take StackNavigation for Push and Pop with its parameter. Its Working fine. But Now I want to implement after some screen TabBar after StackNavigation, Have any Idea How to Take TabBar after StackNavigation.

注意:我要实现自定义TabBar.

Note : I want to implement Custom TabBar.

请帮助我.

推荐答案

您可以执行

let StackWithTabs1 = StackNavigator({ // stackNavigator inside the tabNavigator
  Screen3:{
    screen: Screen3
  }
  ,Screen4:{
    screen: Screen4
  }
});

let StackWithTabs2 = StackNavigator({ // stackNavigator inside the tabNavigator
      Screen5:{
        screen: Screen5
      }
      ,Screen6:{
        screen: Screen6
      }
    });

let tab_bar = TabNavigator({
      StackWithTabs1 : {
        screen: StackWithTabs1 // Calling the stackNavigators that going to go inside the tabNavigator
      },
      StackWithTabs2 : {
        screen: StackWithTabs2
      }
    });

let InitialStackNavigator = StackNavigator({
  Screen1: {
    screen: Screen1
  },
  Screen2: {
    screen: Screen2
  },
  tabBar: {
    screen: tab_bar // Calling the tabNavigator, wich contains the other stackNavigators
  }
});

只需将您的tabNavigator及其stackNavigators分开声明,然后在主stackNavigator上调用它们即可.

Just declare your tabNavigator and its stackNavigators apart and then call them on the main stackNavigator.

这篇关于TabBar位于React Native的StackNavigation中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 19:28