新增底部導航欄tabbar
阿新 • • 發佈:2020-07-17
效果圖:
如果要新增底部導航欄,最少2個,最多5個。
app.json
{ "pages": [ "pages/index/index", "pages/userConsole/userConsole", "pages/storageConsole/storageConsole", "pages/databaseGuide/databaseGuide", "pages/addFunction/addFunction", "pages/deployFunctions/deployFunctions", "pages/chooseLib/chooseLib","pages/openapi/openapi", "pages/openapi/serverapi/serverapi", "pages/openapi/callback/callback", "pages/openapi/cloudid/cloudid", "pages/im/im", "pages/im/room/room" ], "window": { "backgroundColor": "#ddd", "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#F6F6F6","navigationBarTitleText": "我的微信", "navigationBarTextStyle": "black", "enablePullDownRefresh": true }, "sitemapLocation": "sitemap.json", "style": "v2", "tabBar": { "selectedColor": "#00ff00", "borderStyle": "black", "list": [ { "pagePath": "pages/index/index","text": "首頁", "iconPath": "images/2.jpg", "selectedIconPath": "images/1.jpg" }, { "pagePath": "pages/im/im", "text": "日誌", "iconPath": "images/4.jpg", "selectedIconPath": "images/3.jpg" } ] }, "networkTimeout": { "request": 20000, "connectSocket": 20000, "uploadFile": 20000, "downloadFile": 20000 }, "debug":true }
tabBar就是底部導航欄:
- selectedColor:被選中時顯示的顏色
- borderStyle:導航欄與頁面的邊界,就是那個分隔線,當為white時,分隔線就看不見了。
- pagePath:跳轉頁面的路徑
- text:顯示文字
- iconPath:導航圖示路徑
- selectedIconPath:當選中時導航圖示路徑
networkTimeout是延時,單位是ms
debug是開啟debug模式,這樣在除錯視窗可以看到具體的跳轉資訊等。