1. 程式人生 > >【小程式】小程式中設定 tabBar

【小程式】小程式中設定 tabBar

小程式中 tabBar 的設定,tabBar 就是底部導航欄,在app.json中配置。
list 為陣列至少兩項。tab欄的 position 為 top 時間,不顯示圖示。

"tabBar": { 
  "color": "#a9b7b7", 
  "selectedColor": "#11cd6e", 
  "borderStyle":"black",
 "backgroundColor": "#ffffff", 
  "list": [{ 
    "selectedIconPath": "images/111.png", 
    "iconPath": "images/11.png", 
    "pagePath": "pages/index/index", 
    "text": "首頁" 
  }, { 
    "selectedIconPath": "images/221.png", 
    "iconPath": "images/22.png", 
    "pagePath": "pages/logs/logs", 
    "text": "日誌" 
  }] 
}