微信小程序tabBar不出现或者让个性菜单tabBar不展示在首页的解决方案

本文介绍了微信小程序中tabBar不出现或不在首页显示的常见问题,并提供了两种解决方案。一种是在欢迎页面通过事件控制TabBar的显示,另一种是通过调整app.json配置使TabBar在欢迎页面显示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

很多新手小白写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/posts",
	        "text": "美文",
	        "iconPath": "images/posts/wenzi1.png",
	        "selectedIconPath": "images/posts/wenzi2.png"
	      },
	      {
	        "pagePath": "pages/movie/movie",
	        "text": "电影",
	        "iconPath": "im
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值