1. tabbar 不显示
刚开始给页面加tabbar时
{
"pages":[
"pages/index/index",
"pages/all/all",
"pages/relax/relax",
"pages/me/me",
"pages/wen/wen",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle":"black"
},
"tabBar": {
"color": "#a9b7b7",
"selectedColor": "#11cd6e",
"borderStyle":"white",
"list": [{
"selectedIconPath": "images/all2.png",
"iconPath": "images/all1.png",
"pagePath": "pages/all/all",
"text": "all"
}, {
"selectedIconPath": "images/wen2.png",
"iconPath": "images/wen1.png",
"pagePath": "pages/wen/wen",
"text": "文"
}, {
"selectedIconPath": "images/relax2.png",
"iconPath": "images/relax1.png",
"pagePath": "pages/relax/relax",
"text": "relax"
}, {
"selectedIconPath": "images/me2.png",
"iconPath": "images/me1.png",
"pagePath": "pages/me/me",
"text": "我"
}]
}
}
创建完每个文件夹后发现一点没报错。可地下的tabbar就是不显示(懵逼状);
网上查到前人经验:
"pages":[
"pages/all/all",
"pages/relax/relax",
"pages/me/me",
"pages/wen/wen",
"pages/logs/logs",
"pages/index/index"
],
底下的配置都不用改,只是将pages里面的index文件不要放在第一行,tabbar就神奇的出现了
原因是在pages配置的时候第一行写那个页面小程序进来就显示那个页面,如果第一行写index页,而底下配置(relax,me,all,wen,)都是新起的页面,如果显示index当然就看不见底下的tabbar,当然也不会报错