本文小编为大家详细介绍“小程序TabBar不出现如何解决”,内容详细,步骤清晰,细节处理妥当,希望这篇“小程序TabBar不出现如何解决”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。
小程序TabBar不出现的原因:
app.json正确代码:
{ "pages":[ "pages/index/index", "pages/leader/leader", "pages/leader/stories/stories", "pages/leader/authors/authors", "pages/stack/stack", "pages/stack/booklist/booklist", "pages/stack/booklist/bookdetail/bookdetail", "pages/bookdesk/bookdesk", "pages/mine/mine", "pages/mine/news/news", "pages/logs/logs" ], "window":{ "backgroundTextStyle":"light", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "网易蜗牛读书", "navigationBarTextStyle":"black" }, "tabBar":{ "color":"#999999", "selectedColor":"#444444", "backgroungColor":"#ffffff", "borderStyle":"#e0e0e0", "list": [ { "pagePath":"pages/leader/leader", "iconPath": "assets/icons/lingdu.png", "selectedIconPath": "assets/icons/lingdu_sel.png", "text":"领读" }, { "pagePath":"pages/stack/stack", "iconPath": "assets/icons/stack.png", "selectedIconPath": "assets/icons/stack_sel.png", "text":"分类" }, { "pagePath": "pages/bookdesk/bookdesk", "iconPath": "assets/icons/bookdesk.png", "selectedIconPath": "assets/icons/bookdesk_sel.png", "text":"书桌" }, { "pagePath":"pages/mine/mine", "iconPath": "assets/icons/mine.png", "selectedIconPath": "assets/icons/mine_sel.png", "text":"我的" } ] }}
小程序TabBar不出现怎么办?
小程序TabBar不出现解决有两种方式:
1.pages里的首个页面必须在list数组里有配置,所以在lists数组里加一个字典对象即可。
{ "pagePath":"pages/index/index", "iconPath": "assets/icons/index.png", "selectedIconPath": "assets/icons/index_sel.png", "text":"首页" }
但是我的TabBar又不想有这个item显示,这里看第二种解决办法。
2.pages数组的第一项必须是tabBar的list数组的一员:
这里有个疑惑:
百度了解决方法,显示将list数组加了index的模块item,后面不想要index模块在TabBar显示,然后又删除再运行,问题就解决了,也没有设置pages数组的第一项必须是tabBar的list数组的一员。
读到这里,这篇“小程序TabBar不出现如何解决”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注编程网行业资讯频道。