我有这个导航器,我只想从component = {PagRoutes}隐藏标题(pagRoutes是tabNavigator) 感谢您的帮助
export default function Routes() {
return (
<Stack.Navigator
initialRouteName='Login'
>
<Stack.Screen
name="Home"
component={PagRoutes}
options={{
title: 'Dashboard'
}}
/>
<Stack.Screen name="Login" component={Login}
options={{
headerTitleAlign: 'center',
title: 'Login',
}} />
<Stack.Screen name="Registro" component={Registro}
options={{
headerTitleAlign: 'center',
title: 'Registro',
}} />
</Stack.Navigator>
)
}
export default function PagRoutes() {
return (
<Tab.Navigator>
<Tab.Screen name="Home" component={Home} />
<Tab.Screen name="Exercicios" component={Exercicios} />
</Tab.Navigator>
)
}
答案 0 :(得分:1)
您可以为<Stack.Screen />
进行额外的配置。您正在寻找选项:headerShown: none
。我会做这样的事情:
<Stack.Screen
name="Home"
component={PagRoutes}
options={{
title: 'Dashboard',
headerShown: none
}}
/>