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


个人记录


微信小程序 | 隐藏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/[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() 方法,直接调用即可
在这里插入图片描述


三、效果图

在这里插入图片描述


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章