React Native:tabBarVisible 选项设置为 false 但不隐藏 tabBar
React Native: tabBarVisible option set to false but not hidding the the tabBar
我正在使用 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,
}}
/>
),
})}
/>
...
任何建议。
这应该适用于最新版本的软件包:
<Tab.Screen
name="Settings"
component={SettingsScreen}
options={{ tabBarStyle: { display: 'none' } }}
/>
我正在使用 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,
}}
/>
),
})}
/>
...
任何建议。
这应该适用于最新版本的软件包:
<Tab.Screen
name="Settings"
component={SettingsScreen}
options={{ tabBarStyle: { display: 'none' } }}
/>