对某些屏幕的反应导航隐藏标题图标
我使用底部标签栏,对于第一个屏幕,我不想显示“回到”按钮图标。
我在标签顶部使用了标头
。
const AccountStack = ({navigation}) => {
return (
<>
<View>
<Icon // this the back button
name="chevron-left"
type="font-awesome"
color={'#ffffff'}
onPress={() => {
navigation.pop();
}}
/>
<Image
style={{height: 30, width: 170}}
source={require('./src/assets/logo-white.png')}
/>
</View>
<Tab.Navigator
initialRouteName={'WinterStack'}
screenOptions={{
headerShown: false,
tabBarShowLabel: true,
animation: 'fade',
}}>
<Tab.Screen
name="WinterStack"
component={WinterStack}/>
<Tab.Screen
name="SummerStack"
component={SummerStack}/>
<Tab.Screen
name="SettingsStack"
component={SettingsStack}/>
</Tab.Navigator>
</>
);
};
i use bottom tab bar and for the first screens i don't want to show back button icon.
and i used header at the top of tab.navigator
is there a easy way to do it
const AccountStack = ({navigation}) => {
return (
<>
<View>
<Icon // this the back button
name="chevron-left"
type="font-awesome"
color={'#ffffff'}
onPress={() => {
navigation.pop();
}}
/>
<Image
style={{height: 30, width: 170}}
source={require('./src/assets/logo-white.png')}
/>
</View>
<Tab.Navigator
initialRouteName={'WinterStack'}
screenOptions={{
headerShown: false,
tabBarShowLabel: true,
animation: 'fade',
}}>
<Tab.Screen
name="WinterStack"
component={WinterStack}/>
<Tab.Screen
name="SummerStack"
component={SummerStack}/>
<Tab.Screen
name="SettingsStack"
component={SettingsStack}/>
</Tab.Navigator>
</>
);
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在选项卡上的“ screenoptions”上的“ screenoptions”上的标题内的后按钮放置视图。Navigator,然后在选项卡上设置“标题:false”。屏幕上的屏幕不显示所需的屏幕上的标题。
You can put the View with the back button inside header on 'screenOptions' on Tab.Navigator, then set 'headerShown:false' on Tab.Screen to not show the header on the screen you want.