微信小程序 | 隱藏底部菜單欄 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() 方法,直接調用即可
在這裏插入圖片描述


三、效果圖

在這裏插入圖片描述


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