小程序开发——tabbar

小程序的tabbar使用比较简单,只需要在app.json文件里面加上下面的tabbar数组即可

"tabBar": {
//未选择的颜色
    "color": "#AAAAAA",
    //选中的颜色
    "selectedColor": "#3081f3",
    //tabbar数组
    "list": [
      {
      //页面路径
        "pagePath": "pages/home/home",
        //未选中的图片路径
        "iconPath": "images/acounnt.png",
        //已选中的图片路径
        "selectedIconPath": "images/acounnt.png",
        //文字
        "text": "主页"
      },
      {
        "pagePath": "pages/home/others",
        "iconPath": "images/acounnt.png",
        "selectedIconPath": "images/acounnt.png",
        "text": "其他"
      }
    ]
  }

注意点:颜色的值不能用gray等这种英文,必须是上面的格式

猜你喜欢

转载自blog.csdn.net/liumude123/article/details/80087900
今日推荐