小程序自定义taber闪烁问题

根据官方文档自定义小程序taber中,官方演示代码中的aap.json配置项如下:

{
  "pages": [
    "index/index",
    "index/index2"
  ],
  "tabBar": {
    "custom": true,
    "color": "#7A7E83",
    "selectedColor": "#3cc51f",
    "borderStyle": "black",
    "backgroundColor": "#ffffff",
    "list": [
      {
        "pagePath": "index/index",
        "iconPath": "image/icon_component.png",
        "selectedIconPath": "image/icon_component_HL.png",
        "text": "组件"
      },
      {
        "pagePath": "index/index2",
        "iconPath": "image/icon_API.png",
        "selectedIconPath": "image/icon_API_HL.png",
        "text": "接口"
      }
    ]
  },
  "window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#fff",
    "navigationBarTitleText": "WeChat",
    "navigationBarTextStyle": "black"
  },
  "sitemapLocation": "sitemap.json"
}

此段配置运行前提是创建custom-tab-bar 文件夹,并配置相应的taber配置。但是这段配置在使用时会造成首次切换tab时出现短暂消失问题。经多方资料查找,发现疑似官方对taber功能优化时出现的bug。解决问题只需要将配置中的

"custom": true,

删除即可。

"custom": true的目的似乎是为了开启组件taber,也就是使用创建的custom-tab-bar自定义taber。删除此段以后在custom-tab-bar中自定义的样式不可使用,但首次切换页面时不会出现闪烁问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值