react-native - Wix React Native Navigation 的自定义选项卡导航
问题描述
我是 React Native 的新手。出于导航目的,我正在使用 wix 版本 1.1.486 的 react 本机导航库。
对于标签导航,我已经实现了这一点: -
有没有办法从下到上提升这个标签栏?
负责此的代码: -
import { Navigation } from 'react-native-navigation';
import Icon from 'react-native-vector-icons/Ionicons';
const startTabs = ()=>{
Promise.all([
Icon.getImageSource("md-map",30),
Icon.getImageSource("ios-share-alt",30)
]).then(sources =>{
Navigation.startTabBasedApp({
tabs: [
{
label: 'One',
title: 'One',
screen: 'prabhuji.FlowerTabOne',
icon: sources[0]
},
{
label: 'Two',
title: 'Two',
screen: 'prabhuji.FlowerTabTwo',
icon: sources[1]
},
{
label: 'Three',
title: 'Three',
screen: 'prabhuji.FlowerTabThree',
icon: sources[1]
},
{
label: 'Four',
title: 'Four',
screen: 'prabhuji.FlowerTabFour',
icon: sources[0]
}
],
tabsStyle: {
},
appStyle: {
orientation: 'portrait', // Sets a specific orientation to the entire app. Default: 'auto'. Supported values: 'auto', 'landscape', 'portrait'
tabBarBackgroundColor: '#0f2362',
}
});
});
}
export default startTabs;
解决方案
好吧,这个问题很久以前就被问过了,但它似乎仍然活跃,所以我会回答它。
您可以使用 iconInsets 将这个标签栏从下到上提升:{ top: 5, bottom: -5 }
请明显带有值。Exmapl 代码可能是这样的
{
component: {
id: "accountsScreenBottomTabId",
name: "TraderCientzone.AccountsScreen",
waitForRender: true,
options: {
layout: {
orientation: "portrait",
},
bottomTab: {
iconColor: "#363636",
selectedIconColor: "#ccb134",
selectedTextColor: "#ccb134",
text: localString("BOTTOM_MENU.ACCOUNT", locale),
// icon: { uri: "acounts_icon" },
icon: AccountsNormal,
iconInsets: { top: 5, bottom: -5 },
},
},
},
},
推荐阅读
- git - 由于任务失败,提交失败后挂起“恢复到原始状态”Git 消息
- java - 创建后立即并行执行三个 Mono,等待所有人完成并使用特定的顺序/逻辑收集结果
- sed - i 命令之后的行中的前导空格被修剪
- java - PreUpdate 注释未触发更新日期
- python - 检测表作为表面给出了很多矩形
- azure - 我可以将 MABS 安装在我用于可用性组的 wsfc 集群中的节点服务器中吗?如果不是那为什么?
- find - 使用命令 `find 时如何显示已删除的文件。-name sample.txt -delete`
- sdn - 虽然我可以访问 ONOS CLI,但我无法访问 http://localhost:8181/onos/ui
- javascript - 如何在网页上进行编辑以更改另一个网页上的显示
- cors - SAM 应用程序部署提供预检错误,但如果我在 aws apigateway 控制台中创建 OPTIONS 方法,我的预检通过