目錄
一、tabBar的介紹
二、tabBar的6個組成部分
三、tabBar節(jié)點(diǎn)的配置項
四、tab項的配置選項
五、tabBar的使用
一、tabBar的介紹
tabBar是移動端應(yīng)用常見的頁面效果,用于實(shí)現(xiàn)多頁面的快速切換。小程序中通常將其分為:
(1)底部tabBar
(2)頂部tabBar
注意:
(1)tabBar中只能配置最少2個,最多5個tab頁簽
(2)當(dāng)渲染頂部tabBar時,不顯示icon(也就是說所謂的圖標(biāo)不會出現(xiàn)),只顯示文本文章來源:http://www.zghlxwxcb.cn/news/detail-712832.html
二、tabBar的6個組成部分
backgroundColor: tabBar的背景顏色 selectedIconPath:選中時的圖片路徑 borderStyle: tabBar上邊框的顏色 iconPath: 未選中時的圖片路徑 selectedColor: tab上的文字選中的顏色 color: tab上文字的默認(rèn)(未選中)的顏色
三、tabBar節(jié)點(diǎn)的配置項
屬性 類型 必填 默認(rèn)值 說明 position String 否 bottom tabBar的位置,僅支持bottom/top borderStyle String 否 black tabBar上邊框的顏色,僅支持black/white color HexColor 否 tab上文字的默認(rèn)(未選中)顏色 selectedColor HexColor 否 tab上的文字選中時的顏色 backgroundColor HexColor 否 tabBar的背景色 list Array 是 tab頁簽的列表,最少2個,最多5個
四、tab項的配置選項
屬性 類型 必填 說明 pagePath String 是 頁面路徑,頁面必須在pages中預(yù)先定義 text String 是 tab上顯示的文字 iconPath String 否 未選中時的圖標(biāo)路徑;當(dāng)position為top時,不顯示icon selectedIconPath String 否 選中時的圖標(biāo)路徑;當(dāng)position為top時,不顯示icon
五、tabBar的使用
"tabBar": { "list": [ { "pagePath": "pages/index/index", "text": "主頁面" }, { "pagePath": "pages/message/message", "text": "消息" } ] },
文章來源地址http://www.zghlxwxcb.cn/news/detail-712832.html
到了這里,關(guān)于微信小程序的開發(fā)---tabBar的介紹的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!