收藏
回答

小程序tabBar设置selectedColor不起作用?

基础库版本:2.11.0

app.json设置tabBar:

  "tabBar": {

    "color": "#a9b7b7",  

    "selectedColor": "#0000ff",  

    "borderStyle": "black" ,

    "list": [

      {

        "pagePath": "pages/welcome/home/home",

        "text": "首页",

        "iconPath": "/static/icon/home.png",

        "selectedIconPath": "/static/icon/home-select.png"

      },

      {

        "pagePath": "pages/tenders/tenders_list/tenders_list",

        "text": "招标公告",

        "iconPath": "/static/icon/message.png",

        "selectedIconPath": "/static/icon/message-select.png"

      },

      {

        "pagePath": "pages/mine/myhome/myhome",

        "text": "我的",

        "iconPath": "/static/icon/me.png",

        "selectedIconPath": "/static/icon/me-select.png"

      }

    ]

  }

效果图:

已经设置了选中的颜色,但是不起作用,文字颜色还是显示的绿色,而且这绿色不知道从哪来的,默认的?

麻烦遇到的童鞋帮忙解答下?


最后一次编辑于  2020-06-09
回答关注问题邀请回答
收藏

2 个回答

  • Mr.Zhao
    Mr.Zhao
    2020-06-09

    不应该是绿色吗?


    2020-06-09
    有用 1
    回复 5
    • 韦小宝
      韦小宝
      2020-06-09
      这个是我后来调的,你把我代码里面的selectedColor改成#0000ff试试,还是绿色....
      2020-06-09
      回复
    • Mr.Zhao
      Mr.Zhao
      2020-06-09回复韦小宝
      你真行
      2020-06-09
      回复
    • 韦小宝
      韦小宝
      2020-06-09回复Mr.Zhao
      笔误,笔误
      2020-06-09
      回复
    • Mr.Zhao
      Mr.Zhao
      2020-06-09回复韦小宝
      https://developers.weixin.qq.com/s/NT1CWZml7ahk  无法复现
      2020-06-09
      回复
    • 韦小宝
      韦小宝
      2020-06-09回复Mr.Zhao
      找到原因了,不是tabBar组件失效了,不知道哪个二货在app.js里面重设了下color,谢谢了
      2020-06-09
      回复
  • 韦小宝
    韦小宝
    2020-06-09

    谁级别高的,帮我邀请腾讯的技术过来看看

    2020-06-09
    有用
    回复
登录 后发表内容
问题标签