在app.json中配置如下:
"tabBar": {
"color": "#a9b7b7",
"selectedColor": "#00BFFF",
"borderStyle": "white",
"list": [
{
"selectedIconPath": "./images/tabbaricon/home2.png",
"iconPath": "./images/tabbaricon/home1.png",
"pagePath": "pages/index/index",
"text": "首页"
},
{
"selectedIconPath": "./images/tabbaricon/me2.png",
"iconPath": "./images/tabbaricon/me1.png",
"pagePath": "pages/index/index",
"text": "我"
}
]
}
这个时候模拟器能正常显示,真机只会显示一个:(左真机,右模拟器),
在pagePath所指的页面必须要实实在在存在,真机上才会全部显示。有时候临时测试,链接同一个页面就会显示不全。ps:color等的设置不能使用颜色的英文名必须使用:‘’#a9b7b7’;