收藏
回答

为什么自定义tabBar在鸿蒙系统6.X版本,多次点击后字体放大?

刚进入小程序的时候,底部tabBar是正常的

但是反复点击切换不同的tab页面(大概切换三次)就会突然出现tabBar字体变大的情况

这个问题在安卓和iOS系统中没有出现,目前仅出现在鸿蒙6系统当中,这是为什么呢?有人遇到这个情况吗?


以下是提供的代码片段

<cover-view class="custom-tab-bar">
  <cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bind:tap="switchTab">
    <cover-image class="icon" src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></cover-image>
    <cover-view class="{{selected === index ? 'name checked' : 'name'}}">{{item.text}}</cover-view>
  </cover-view>
</cover-view>


.custom-tab-bar {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 999;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
  width: 100%;
  height: 71px;
  background-color: #fff;
  border-top: 0.5px solid #E3E3E3;
  display: flex;
}
.custom-tab-bar .tab-bar-item {
  height: 71px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.custom-tab-bar .tab-bar-item .icon {
  margin: 10px auto 2px;
  width: 28px;
  height: 28px;
}
.custom-tab-bar .tab-bar-item .name {
  color: rgba(0, 0, 0, .3);
  font-size: 12px;
  line-height: 15px;
}
.custom-tab-bar .tab-bar-item .name.checked {
  color: #1368fb;
}


{
  "pages": [],
  "window": {
    "navigationBarTextStyle": "black",
    "navigationBarBackgroundColor": "#ffffff",
    "navigationStyle": "custom"
  },
  "tabBar": {
    "custom": true,
    "list": [
      {
        "pagePath": "pages/home/index",
        "iconPath": "image/tabbar-icons/app.png",
        "selectedIconPath": "image/tabbar-icons/app_selected.png",
        "text": "车内应用"
      },
      {
        "pagePath": "pages/treasure-chest/index",
        "iconPath": "image/tabbar-icons/box.png",
        "selectedIconPath": "image/tabbar-icons/box_selected.png",
        "text": "百宝箱"
      },
      {
        "pagePath": "pages/user/index",
        "iconPath": "image/tabbar-icons/user.png",
        "selectedIconPath": "image/tabbar-icons/user_selected.png",
        "text": "我的"
      }
    ]
  },
  "componentFramework": "glass-easel",
  "sitemapLocation": "sitemap.json",
  "lazyCodeLoading": "requiredComponents"
}
回答关注问题邀请回答
收藏

3 个回答

  • 社区技术运营专员-Jahozheng
    社区技术运营专员-Jahozheng
    2025-11-21

    你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及按照链接能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

    2025-11-21
    有用
    回复 3
    • 没什么大不了
      没什么大不了
      2025-12-30
      相同的问题,请问现在有解决了吗
      2025-12-30
      回复
    • 菠罗咕咾肉
      菠罗咕咾肉
      01-29
      +1
      01-29
      回复
    • 未茗
      未茗
      01-30
      相同的问题,请问现在有解决了吗
      01-30
      回复
  • Marvel
    Marvel
    2025-12-29

    相同的问题,请问现在解决了吗?

    2025-12-29
    有用
    回复 1
  • 智能回答 智能回答 本次回答由AI生成
    2025-11-19
    有用
登录 后发表内容