微信小程序添加底部自定義導航欄(tabBar)


tabBar參數說明參考: 官網文檔

具體配置:

1、在app.json中添加你的自定義導航欄信息(名字,點擊前圖片,點擊后圖片,要跳轉的界面等等)

注意事項:tabBar最多五個

 

參考示例:

"tabBar": {
    "color": "#8a8a8a",
    "selectedColor": "#937bf5",
    "list": [
      {
        "iconPath": "images/tabbar/index.png",
        "selectedIconPath": "images/tabbar/index_active.png",
        "pagePath": "pages/index/index",
        "text": "首頁"
      },
      {
        "iconPath": "images/tabbar/near.png",
        "selectedIconPath": "images/tabbar/near_active.png",
        "pagePath": "pages/near/near",
        "text": "附近"
      },
      {
        "iconPath": "images/tabbar/message.png",
        "selectedIconPath": "images/tabbar/message_active.png",
        "pagePath": "pages/message/message",
        "text": "消息"
      },
      {
        "iconPath": "images/tabbar/user.png",
        "selectedIconPath": "images/tabbar/user_active.png",
        "pagePath": "pages/user/user",
        "text": "我的"
      }
    ]
  }
View Code

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM