第一步
在app.json文件找到“tarBar”对象,然后添加一个属性,代码如下:
"tabBar": {"custom": true, //添加这个属性
"color": "#707070","selectedColor": "#00c4cc","list": [
{"pagePath": "pages/home/index","iconPath": "/static/img/home_def.png","selectedIconPath": "/static/img/home_sel.png","text": "首页"},
{"pagePath": "pages/catetory/index","iconPath": "/static/img/type_def.png","selectedIconPath": "/static/img/type_sel.png","text": "分类"},
{"pagePath": "pages/home/index","iconPath": "/static/img/my_def.png","selectedIconPath": "/static/img/my_sel.png","text": "我的"}
]
}
第二步
在pages文件夹同级目录下,新建一个文件夹,文件夹名称为 “custom-tab-bar”