【小程序】tabbar用法

tabBar  指底部的 导航配置属性

color  未选择时 底部导航文字的颜色

selectedColor  选择时 底部导航文字的颜色

borderStyle  底部导航边框的样色(注意 这里如果没有写入样式 会导致 导航框上边框会出现默认的浅灰色线条)

list   导航配置数组

selectedIconPath 选中时 图标路径

iconPath 未选择时 图标路径

pagePath 页面访问地址

text  导航图标下方文字;

"tabBar": {
"color": "#a9b7b7",
"selectedColor": 
"#11cd6e",
"borderStyle": 
"black",
"list": [

{
"selectedIconPath": 
"images/icon_consult_press.png",
"iconPath": "images/icon_consult.png",
"pagePath": "pages/index/index",
"text": "首页"
},
{
"selectedIconPath": 
"images/icon_invest_press.png",
"iconPath": "images/icon_invest.png",
"pagePath": "pages/logs/logs",
"text": "一元投"
},

{
"selectedIconPath": 
"images/icon_mine_press.png",
"iconPath": "images/icon_mine.png",
"pagePath": "pages/mine/mine",
"text": "我的"
}
] 
}
注意: 每个页面的json文件都不能去掉navigationBarTitleText这个属性。否则会报错

猜你喜欢

转载自blog.csdn.net/wangjia55/article/details/80567033
今日推荐