底部导航栏代码写在app.json里面
首先你要确定有这几个页面,代码正确
假设我只有底部导航栏只有三个,先pages得到这三个页面
"pages":[ "pages/index/index", "pages/detail/detail", "pages/user/user" ]
记住,最后一条数据不要打逗号
然后写底部导航栏:
"tabBar":{ "color": "#888888",//导航栏文字颜色 "selectedColor": "green",//导航栏选中文字颜色 "backgroundColor": "#fff",//导航栏背景颜色 "borderStyle": "white",//导航栏上边框的颜色 "list":[ { "pagePath":"pages/index/index",//点击相应导航栏出现的页面 "text":"首页", "iconPath":"img/one.png",//导航栏未选中时图标 "selectedIconPath": "img/one-1.png" //导航栏选中时图标 }, { "pagePath":"pages/detail/detail", "text": "大壳", "iconPath": "img/two.png", "selectedIconPath": "img/two-2.png" }, { "pagePath":"pages/user/user", "text": "我的", "iconPath": "img/three.png", "selectedIconPath": "img/three-3.png" } ] }
最后一条数据不要打逗号!!!!
这样就可以得到底部导航栏了
如果有错误的地方请指出来,谢谢