微信小程序tabbar不显示解决办法
程序员文章站
2022-07-05 20:25:04
微信小程序tabbar不显示解决办法
"pages":[
"pages/logs/logs",
"pages/index/index"
],...
微信小程序tabbar不显示解决办法
"pages":[ "pages/logs/logs", "pages/index/index" ],
微信小程序在测试tabbar的时候怎么都不显示。
我就不贴api了。直接上代码
{ "pages":[ "pages/logs/logs", "pages/index/index" ], "window":{ "backgroundtextstyle":"light", "navigationbarbackgroundcolor": "#fff", "navigationbartitletext": "小程序", "navigationbartextstyle":"black" }, "tabbar":{ "selectedcolor":"#dddddd", "color": "#3cc51f", "backgroundcolor":"#ffffff", "list":[{ "text" : "登录", "pagepath" : "pages/logs/logs", "iconpath" : "image/12.png", "selectediconpath" : "image/12.png" },{ "text":"注销", "pagepath" : "pages/index/index", "iconpath" : "image/12.png", "selectediconpath" : "image/12.png" },{ "text" : "日志", "pagepath" : "pages/logs/logs", "iconpath" : "image/12.png", "selectediconpath" : "image/12.png" }] } }
这个json看了一天,直觉告诉我没什么问题。实际上也没什么问题。
但是坑爹的一幕来了,tabbar怎么都不显示。最后发现是
"pages":[ pages/logs/logs", "pages/index/index" ],
看标红的问题。第一行绝对是不能配置为"pages/index/index"。所以我换成了pages/logs/logs要不然是不会显示tabbar的
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!