微信小程序

一、底部導航欄

// 找到項目根目錄中的配置文件 app.json 加入如下配置信息

"tabBar": {
    "color": "#a9b7b7",
    "selectedColor": "#11cd6e",
    "borderStyle": "white",
    "list": [
      {
        "selectedIconPath": "image/tab_home_select.png",
        "iconPath": "image/tab_home.png",
        "pagePath": "pages/home/home",
        "text": "首頁"
      },
      {
        "selectedIconPath": "image/tab_msg_select.png",
        "iconPath": "image/tab_msg.png",
        "pagePath": "pages/message/message",
        "text": "消息"
      },
      {
        "selectedIconPath": "image/tab_me_select.png",
        "iconPath": "image/tab_me.png",
        "pagePath": "pages/my/my",
        "text": "我的"
      }
    ]
  }

屬性的解釋
       tabBar  指底部的 導航配置屬性

       color  未選擇時 底部導航文字的顏色

       selectedColor  選擇時 底部導航文字的顏色

       borderStyle  底部導航邊框的樣色(注意 這裏如果沒有寫入樣式 會導致 導航框上邊框會出現默認的淺灰色線條)

       list   導航配置數組

       selectedIconPath 選中時 圖標路徑

       iconPath 未選擇時 圖標路徑

       pagePath 頁面訪問地址

       text  導航圖標下方文字

 

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