首页 > 技术文章 > 小程序底部导航栏

SunSong 2017-06-01 18:21 原文

在app.json文件中添加如下代码:

"tabBar": {
"color": "black",
"backgroundColor":"#fff",
"selectedColor": "#11cd6e",
"borderStyle":"white",
"list": [{
"selectedIconPath": "image/home_HL.png",
"iconPath": "image/home.png",
"pagePath": "pages/index/index",
"text": "首页"
}, {
"selectedIconPath": "image/1168874.png",
"iconPath": "image/dingdan.png",
"pagePath": "pages/logs/logs",
"text": "订单"
}, {
"selectedIconPath": "image/508421.png",
"iconPath": "image/508417.png",
"pagePath": "pages/mine/mine",
"text": "我的"
}]
}

//selectedIconPath:选中时的图片样式

iconPath没选中时的图片

pagePath:跳转的页面链接

backgroundColor:选中时字的颜色

推荐阅读