美團(tuán)外賣小程序標(biāo)題欄的樣式及添加底欄
添加底欄,標(biāo)題欄樣式是小程序非?;镜慕Y(jié)構(gòu),這里以美團(tuán)外賣為例:
美團(tuán)外賣標(biāo)題欄樣式配置
1."window":{
2."navigationBarTitleText": "美團(tuán)外賣+",
3."navigationBarTextStyle": "white",
4."navigationBarBackgroundColor": "#FFC640"
5.},
同樣是在app.json中配置,其他頁面的標(biāo)題欄都以此為例。
美團(tuán)外賣添加底欄
1."tabBar": {
2."color": "#272636",
3."selectedColor": "#FFD161",
4."backgroundColor": "#fff",
5."borderStyle": "#a8a8a8",
6."list": [
7.{
8."pagePath": "pages/home/home",
9."iconPath": "pages/images/home.png",
10."selectedIconPath": "pages/images/home-selected.png",
11."color":"white",
12."text": "首頁"
13.},
14.{
15."pagePath": "pages/order/order",
16."iconPath": "pages/images/order.png",
17."selectedIconPath": "pages/images/order-selected.png",
18."text": "訂單"
19.},
20.{
21."pagePath": "pages/my/my",
22."iconPath": "pages/images/my.png",
23."selectedIconPath": "pages/images/my-selected.png",
24."text": "我的"
25.}
26.]
27.}
在app.json中編寫以上代碼,這是小程序自帶的功能,只需要照搬照抄就可以了,極其方便,效果如下: