午夜无码人妻aⅴ大片色欲张津瑜,国产69久久久欧美黑人A片,色妺妺视频网,久久久久国产综合AV天堂

微信小程序如何實(shí)現(xiàn)tabBar

這篇文章主要介紹了微信小程序如何實(shí)現(xiàn)tabBar,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

創(chuàng)新互聯(lián)建站主營雁峰網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,成都app軟件開發(fā)公司,雁峰h5小程序定制開發(fā)搭建,雁峰網(wǎng)站營銷推廣歡迎雁峰等地區(qū)企業(yè)咨詢

具體如下:

1、效果展示

微信小程序如何實(shí)現(xiàn)tabBar

2、原理:在app.json中配置tabBar屬性

{
 "pages": [
  "index",
  "picDisplay"
 ],
 "window": {
  "navigationBarBackgroundColor": "#ffffff",
  "navigationBarTextStyle": "black",
  "navigationBarTitleText": "首頁",
  "backgroundColor": "#eeeeee",
  "backgroundTextStyle": "light",
  "enablePullDownRefresh": false
 },
 "tabBar": {
  "color":"#666666",
  "selectedColor":"#06bd04",
  "list": [{
   "pagePath": "index",
   "text": "首頁",
   "iconPath": "images/index.png",
   "selectedIconPath": "images/indexHL.png"
  },{
   "pagePath": "picDisplay",
   "text": "圖片展示",
   "iconPath": "images/picDisplay.png",
   "selectedIconPath": "images/picDisplayHL.png"
  }]
 }
}

3、關(guān)鍵代碼

"tabBar": {
  "color":"#666666",
  "selectedColor":"#06bd04",
  "list": [{
   "pagePath": "index",
   "text": "首頁",
   "iconPath": "images/index.png",
   "selectedIconPath": "images/indexHL.png"
  },{
   "pagePath": "picDisplay",
   "text": "圖片展示",
   "iconPath": "images/picDisplay.png",
   "selectedIconPath": "images/picDisplayHL.png"
  }]
 }

4、操作方法

新建一個(gè)項(xiàng)目,打開app.json文件,將關(guān)鍵代碼復(fù)制到"window":{},后面,注意window的大括號前加逗號,如下圖

微信小程序如何實(shí)現(xiàn)tabBar

配置tabBar屬性值

"tabBar": {
  //設(shè)置tabBar文字默認(rèn)顏色
  "color":"#666666",
  //設(shè)置tabBar文字被選中是的顏色
  "selectedColor":"#06bd04",
  //tab列表,數(shù)組類型,改數(shù)組內(nèi)至少要有兩個(gè)但不大于5個(gè)的tab對象
  "list": [{
   //設(shè)置tab跳轉(zhuǎn)頁面鏈接
   "pagePath": "index",
   //設(shè)置tab上的文字
   "text": "首頁",
   //設(shè)置tab上的默認(rèn)圖標(biāo)
   "iconPath": "images/index.png",
   //設(shè)置tab被選中時(shí)的圖標(biāo)
   "selectedIconPath": "images/indexHL.png"
  },{
   "pagePath": "picDisplay",
   "text": "圖片展示",
   "iconPath": "images/picDisplay.png",
   "selectedIconPath": "images/picDisplayHL.png"
  }]
 }

tabBar的5種常用屬性與配置說明:

1) color:未選擇字體顏色

2) selectedColor:選擇字體顏色

3) borderStyle:tabbar上方線的顏色white(僅支持白色和黑色)

4) backgroundColor:tabbar背景顏色

5) list:設(shè)置rab列表項(xiàng)(最少2個(gè),最多5個(gè)tab)。

另外,list作為數(shù)組屬性,其每一項(xiàng)又是一個(gè)對象,list可以設(shè)置4種屬性:

① text:設(shè)置tab上的文字

② iconPath:設(shè)置tab處于未激活狀態(tài)時(shí)顯示的圖片路徑。

③ selectedIconPath:設(shè)置tab處于激活狀態(tài)時(shí)的圖片路徑(iconPath與selectedIconPath圖片大小限制都是40KB)

④ pagePath:設(shè)置觸按tab時(shí)的跳轉(zhuǎn)頁面路徑(該頁面必須在pages中進(jìn)行了配置)

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“微信小程序如何實(shí)現(xiàn)tabBar”這篇文章對大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!

本文題目:微信小程序如何實(shí)現(xiàn)tabBar
本文鏈接:http://www.ekvhdxd.cn/article14/ihpcde.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應(yīng)式網(wǎng)站、網(wǎng)站排名軟件開發(fā)、品牌網(wǎng)站設(shè)計(jì)虛擬主機(jī)、ChatGPT

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化