【发布时间】:2021-09-03 10:01:00
【问题描述】:
我正在使用 React Navigation v5,但是当我将选项 tabBarVisible 设置为 false 时,tabBar 并没有隐藏。这是一段不起作用的代码。不知道怎么回事。
..
<Tabs.Navigator screenOptions={screenOptions} initialRouteName="Home">
<Tabs.Screen
name="Home"
component={Home}
options={({ route }) => ({
tabBarVisible: false, // <-- This not working
tabBarIcon: (props) => (
<TabIcon
{...props}
title="Home"
Icon={{
name: "home",
IconComponent: AntDesign,
}}
/>
),
})}
/>
...
任何建议。
【问题讨论】:
-
在
screenOptions中你可以将 propheaderShown设置为 false 就像screenOptions={{ headerShown: false }}一样 -
我对标题不感兴趣,我对标签栏感兴趣,但谢谢哥们。我也试过了,还是不行。
标签: reactjs react-native react-native-navigation