很多新手小白写tabBar的时候会发现明明自己按照微信开发文档的示例写的tabBar,但是却不出自己想要的效果,这个我刚开始写小程序的时候也遇到了同样的问题,现在给大家讲讲我的解决方案
一般我们会在在项目的app.json使用以下代码,却没有如期望那样在屏幕底部出现TabBar。
{
"pages":[
"pages/welcome/welcome",
"pages/index/index",
"pages/posts/posts",
"pages/posts/post_detail/post_detail",
"pages/movie/movie"
],
"window": {
"navigationBarBackgroundColor": "#405f80"
},
"tabBar": {
"color": "#000000",
"borderStyle": "#000",
"selectedColor": "#9999FF",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/posts/wenzi1.png",
"selectedIconPath": "images/posts/wenzi2.png"
},
{
"pagePath": "pages/posts/