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


个人记录


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


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

底部菜单栏:
微信小程序 | 隐藏底部菜单栏 json中的tabBar_第1张图片
代码:

{
  "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/[email protected]",
        "pagePath": "pages/index/index",
        "text": "首页"
      },
      {
        "selectedIconPath": "image/index/ic_market-select.png",
        "iconPath": "image/index/[email protected]",
        "pagePath": "pages/market/market",
        "text": "广告超市"
      },
      {
        "selectedIconPath": "image/index/ic_order-select.png",
        "iconPath": "image/index/[email protected]",
        "pagePath": "pages/order/order",
        "text": "订单"
      },
      {
        "selectedIconPath": "image/index/ic_user-select.png",
        "iconPath": "image/index/[email protected]",
        "pagePath": "pages/user/user",
        "text": "我的"
      }
    ]
  },
  "sitemapLocation": "sitemap.json",
  "permission": {
    "scope.userLocation": {
      "desc": "你的位置信息将用于小程序位置接口的效果展示"
    }
  },
  "networkTimeout": {
    "request": 5000
  }
}


二、隐藏tabBar

代码:

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

使用微信小程序API中的 wx.hideTabBar() 方法,直接调用即可
微信小程序 | 隐藏底部菜单栏 json中的tabBar_第2张图片


三、效果图

微信小程序 | 隐藏底部菜单栏 json中的tabBar_第3张图片


你可能感兴趣的:(日常记录,微信小程序)