微信小程序 | 隐藏底部菜单栏 json中的tabBar

    xiaoxiao2022-07-06  224


    个人记录


    微信小程序 | 隐藏json中的tabBar


    一、小程序的app.json中的底部菜单设置

    底部菜单栏: 代码:

    { "pages": [ "pages/index/index", "pages/login/login" ], "window": { "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "微信小程序", "navigationBarTextStyle": "black" }, "tabBar": { "color": "#AAAAAA", "selectedColor": "#26BAEE", "backgroundColor": "#fff", "borderStyle": "white", "list": [ { "selectedIconPath": "image/index/ic_home-select.png", "iconPath": "image/index/ic_home@2x.png", "pagePath": "pages/index/index", "text": "首页" }, { "selectedIconPath": "image/index/ic_market-select.png", "iconPath": "image/index/ic_market@2x.png", "pagePath": "pages/market/market", "text": "广告超市" }, { "selectedIconPath": "image/index/ic_order-select.png", "iconPath": "image/index/ic_order@2x.png", "pagePath": "pages/order/order", "text": "订单" }, { "selectedIconPath": "image/index/ic_user-select.png", "iconPath": "image/index/ic_user@2x.png", "pagePath": "pages/user/user", "text": "我的" } ] }, "sitemapLocation": "sitemap.json", "permission": { "scope.userLocation": { "desc": "你的位置信息将用于小程序位置接口的效果展示" } }, "networkTimeout": { "request": 5000 } }

    二、隐藏tabBar

    代码:

    wx.hideTabBar()-- 隐藏底部按钮

    使用微信小程序API中的 wx.hideTabBar() 方法,直接调用即可


    三、效果图


    最新回复(0)