⼩程序底部导航栏(tabbar)在app.json处设置“tabBar”,例⼦如下:
{
"pages": [
"pages/index/index",
"pages/pages1/pages1",
"pages/pages2/pages2"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTitleText": "⼩程序名称",
"navigationBarTextStyle": "black",
"backgroundColor": "#EA0000"
},
"sitemapLocation": "sitemap.json",
"tabBar": {
"color": "#666666",
"selectedColor": "#f10b2e",
"list": [
{
"pagePath": "pages/pages1/pages1",
"text": "页⾯1",
"iconPath": "*****",//未选中时的图标
"selectedIconPath": "*****"//选中后的图标
},
{
"pagePath": "pages/pages2/pages2",
"text": "页⾯2",
"iconPath": "*****",//未选中时的图标
"selectedIconPath": "*****"//选中后的图标
}
]
}
}
需要注意的是:其他页⾯要跳转到tabBar页⾯,需要使⽤wx.switchTab,例⼦如下:
wx.switchTab({selectediconpath什么意思
url: '../pages1/pages1'
})
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论