欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

微信小程序 tabBar

程序员文章站 2024-02-16 23:18:40
...

很简单,参考API: https://mp.weixin.qq.com/debug/wxadoc/dev/framework/MINA.html?t=20161107

在app.json里填写:tab个数范围2-5个

"tabBar":{
    "color": "#818181",
    "selectedColor": "#0082D7",
    "borderStyle": "white",
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "首页",
        "iconPath":"res/images/tabar/index.png",
        "selectedIconPath": "res/images/toobar/index01.png"
      },
      {
        "pagePath": "pages/me/me",
        "text": "个人中心",
        "iconPath": "res/images/tabar/me.png",
        "selectedIconPath": "res/images/toobar/me.png"
      },
      {
        "pagePath": "pages/more/more",
        "text": "更多",
        "iconPath": "res/images/tabar/more.png",
        "selectedIconPath": "res/images/toobar/more.png"
      }
    ]
  }

微信小程序 tabBar


微信小程序 tabBar

另外貌似不支持网络获取图片

点击后对应页面根据需要自行添加编写即可