0

我正在尝试在我的应用程序的每个屏幕中显示底部 TabBar,但我还找不到在 RN V5 中执行此操作的方法,

所以当我尝试这样使用tabBarVisible

<BottomTab.Navigator
      lazy={false}
      tabBar={props => <TabBar {...props} />}
      screenOptions={({route}) => (
             console.log('route', route), it's just log the five bottom component i have
             {
             tabBarVisible: ({routes}) => {
             let tabBarVisible = false;
             console.log('screens', routes); // Not log anything!
             return {tabBarVisible};
            },
          }
         )}
        ....
       >
       ... 5 Tabs here
</BottomTab.Navigator>

那么我该如何处理这种情况呢?并访问其他堆栈屏幕?

只是为了最小化有问题的代码片段

这是完整的根文件代码,你能检查一下吗?

4

1 回答 1

0

如果您希望在tabBar应用程序的每个屏幕中显示 ,则需要将其设为您的根导航器,然后所有屏幕都将位于该导航器下,因此tabBar将在所有屏幕中可见。

于 2020-03-30T08:48:13.857 回答