android Wix-Navigation中带有图标的React-native问题,在iOS中工作正常

问题描述

有一个问题,在ios中显示图标正确显示,但是在android中,尺寸减小了,我在React-native中使用Wix导航,所有其他图标在两个平台上均显示完美,但是在导航中添加的图标具有问题

以下是底部标签的代码

 const HomeIcon = require("../assets/images/tabs/home_off.png");
  const HomeIconSelected = require("../assets/images/tabs/home_on.png");

  const HomeIconx = require("../assets/images/home_off.png");
  const HomeIconSelectedx = require("../assets/images/home_on.png");

  const MessageIcon = require("../assets/images/tabs/chat_off.png");
  const MessageIconSelected = require("../assets/images/tabs/chat_on.png");

  const MessageIconx = require("../assets/images/chat_off.png");
  const MessageIconSelectedx = require("../assets/images/chat_on.png");

  const PostIcon = require("../assets/images/tabs/edit.png");
  const PostIconSelected = require("../assets/images/tabs/edit.png");

  const PostIconx = require("../assets/images/edit_home.png");
  const PostIconSelectedx = require("../assets/images/edit_home.png");

  const ProfileIcon = require("../assets/images/tabs/profile_off.png");
  const ProfileIconSelected = require("../assets/images/tabs/profile_on.png");

  const ProfileIconx = require("../assets/images/profile_off.png");
  const ProfileIconSelectedx = require("../assets/images/profile_on.png");

  const NotiIcon = require("../assets/images/tabs/notificatin_off.png");
  const NotiIconSelected = require("../assets/images/tabs/notificatin_on.png");

  const NotiIconx = require("../assets/images/notificatin_off.png");
  const NotiIconSelectedx = require("../assets/images/notificatin_on.png");
  Navigation.setRoot({
    root: {
      id: "root",sideMenu: {
        id: "leftSideMenu",left: leftSideMenu("leftSideMenu",theme),center: {
          bottomTabs: {
            appStyle: {
              forceTitlesDisplay: true,},titleDisplayMode: "alwaysShow",id: "bottomTabs",children: [
              {
                stack: zeroTabStack(
                  Platform.OS == "ios" ? HomeIcon : HomeIconx,Platform.OS == "ios" ? HomeIconSelected : HomeIconSelectedx,theme
                ),{
                stack: firstTabStack(
                  Platform.OS == "ios" ? MessageIcon : MessageIconx,Platform.OS == "ios"
                    ? MessageIconSelected
                    : MessageIconSelectedx,{
                stack: secondTabStack(
                  Platform.OS == "ios" ? PostIcon : PostIconx,Platform.OS == "ios" ? PostIconSelected : PostIconSelectedx,{
                stack: thirdTabStack(
                  Platform.OS == "ios" ? ProfileIcon : ProfileIconx,Platform.OS == "ios"
                    ? ProfileIconSelected
                    : ProfileIconSelectedx,{
                stack: fourthTabStack(
                  Platform.OS == "ios" ? NotiIcon : NotiIconx,Platform.OS == "ios" ? NotiIconSelected : NotiIconSelectedx,],});

导航标题代码

component: {
                        name: TERM_AND_CONDITIONS,passProps: {
                          name: "Settings",options: {
                          topBar: {
                            title: {
                              text: "Terms And Conditions",alignment: "center",color: color.text_color,fontFamily:
                                Platform.OS === "ios"
                                  ? "Roboto-Medium"
                                  : "RobotoRegular",background: { color: color.background },backButton: {
                              icon: Images.back,showTitle: "hide",visible: true,bottomTabs: {
                            backgroundColor:
                              props.theme && props.theme === "dark"
                                ? "#000"
                                : "#fff",

iOS

1

Android

enter image description here

解决方法

即使未提供,似乎Android上的标题文本也是默认呈现的。我通过设置titleDisplayMode: 'alwaysHide'

解决了
Navigation.setRoot({
    root: {
      bottomTabs: {
        children: [...],options: {
          bottomTabs: {
            titleDisplayMode: 'alwaysHide',},})

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...