reactjs - React Native:tabBarVisible 选项设置为 false 但不隐藏 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' } }}
/>
推荐阅读
- javascript - 更改其他产品选项时选择产品数量
- javascript - 将 Angular 添加到现有的 CodeIgniter 项目
- google-apps-script - 使用 Apps 脚本在 Gmail 中创建自定义发送
- java - 上下文与配置类
- python - AttributeError:模块“meep”没有属性“Vector3”
- c++ - 重载的“operator++”返回一个非常量,并且clang-tidy抱怨
- c# - Xamarin 表单选择器中的 System.ArgumentOutOfRangeException
- node.js - 文档必须是有效的 JavaScript 对象
- ios - 视觉工作室 mac ios 捆绑签名平台始终是 iphone 模拟器
- sql - 表的两列之间的序列的最后一个成员