微信小程序tabBar显示问题

来源:互联网 发布:windows curl命令详解 编辑:程序博客网 时间:2024/05/18 15:24

在app.json中定义了多个pages,一般微信小程序启动的时候,自动加载pages下的第一个页面,
{
“pages”:[
“pages/index/index”,
“pages/logs/logs”
],
“window”:{
“backgroundTextStyle”:”light”,
“navigationBarBackgroundColor”: “#fff”,
“navigationBarTitleText”: “WeChat”,
“navigationBarTextStyle”:”black”
},
“tabBar”: {
“color”: “#929292”,
“selectedColor”: “#ff2d55”,
“borderStyle”: “white”,
“list”: [{
“pagePath”: “pages/index/index”,
“text”: “首页”,
“iconPath”: “image/tabbar/2.png”,
“selectedIconPath”: “image/tabbar/2-hl.png”
},
{
“pagePath”: “pages/index/index”,
“text”: “显示”,
“iconPath”: “image/tabbar/1.png”,
“selectedIconPath”: “image/tabbar/1-hl.png”
}]
}
}

如果将index 放在第一行,tabBar并不显示出来,是因为只有当放在第一行的页面是在tabBar的list的某一个页面才可以显示,也就是说index页面是在tabBar的list下面,所以可以显示
这里写图片描述

而且,默认是选中最左边那个

0 0
原创粉丝点击