我正在使用 React 导航并且我想隐藏特定屏幕的选项卡底部栏。所以我遵循了他们网站上的描述:https://reactnavigation.org/docs/hiding-tabbar-in-screens/
它告诉我重新组织我的选项卡和屏幕导航器。但是,如果我这样做,并且我想向一个特定选项卡添加更多屏幕,我不知道如何实现这一点。我尝试了以下方法,但导致了一些问题:
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={HomeTabs}
/>
<Stack.Screen
name="ChatDetails"
component={ChatDetails}
/>
</Stack.Navigator>
</NavigationContainer>
)
}
HOMETABS.JS:
<Tab.Navigator>
<Tab.Screen
name="Home"
component={HomeNavigator}
/>
<Tab.Screen
name="Chats"
component={ChatNavigator}
/>
</Tab.Navigator>
HOMENAVIGATOR.JS
<Stack.Navigator>
<Stack.Screen
name="Home"
component={Profile}
/>
<Stack.Screen
name="Profile"
component={Profile}
/>
</Stack.Navigator>
如何正确嵌套组件,我可以1) 隐藏某些特定屏幕的标签栏,但 2) 还可以向一个标签添加更多屏幕?
谢谢!