背景:
在微信小程序的实际开发过程中,有时候我们需要修改微信小程序提供的 tabBar 组件顶部边框的颜色,以满足项目需求
解决方案:
方式一:
通过tabBar组件自带的 borderStyle 属性来控制边框的颜色,将边框的颜色设置为白色,如下代码:
"borderStyle": "white",
全部代码:
app.json文件
"tabBar": {
"color": "#7B7E82",
"selectedColor": "#333333",
"borderStyle": "white",
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/home_default.png",
"selectedIconPath": "images/home_select.png"
},{
"pagePath": "pages/index/index",
"text": "服务预约",
"iconPath": "images/service_default.png",
"selectedIconPath": "images/service_select.png"
},{
"pagePath": "pages/cemetery/cemetery",