微信小程序tabBar设置
程序员文章站
2024-02-16 23:09:58
...
好的,首先,我们先看看官网的文档:
不认真看文档的就会跟我第一次看的时候一样懵逼,其实很简单,它是这么写的,app.json:
{
"pages": [
"pages/index/index"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "aaaa",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#dadada",
"selectedColor": "#09bb07",
"backgroundColor":"#fff",
"borderStyle": "#f6f6f6",
"list": [
{
"pagePath": "pages/index/index",
"text": "存包"
},{
"pagePath": "pages/fetch/home/home",
"text": "取包"
},{
"pagePath": "pages/business/brand/brand",
"text": "商务合作"
},{
"pagePath": "pages/center/perCenter/perCenter",
"text": "个人中心"
}
]
}
}
如tabBar里面写的,我试了试不按照顺序把backgroundColor写在list后边,然后报错了= =,所以建议大家按照文档顺序来写。
格式如上,done。