我正在尝试在我的应用程序的每个屏幕上显示底部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>
所以我该如何处理这种情况?并访问其他堆栈屏幕?
只是为了最小化所讨论的代码片段
这是full Root file代码,您可以检查吗?
[如果要在应用程序的每个屏幕中显示tabBar
,则需要将其设置为您的根导航器,然后所有屏幕都将在该导航器下方,因此tabBar
在所有屏幕中都可见。] >