微信小程序 之怎么设置底部导航

页面效果

 

操作效果如下

 


 步骤一、去阿里巴巴矢量图网搜索想要的素材

http://www.iconfont.cn/collections/show/29

点击下方的下载

注意点

1、大小64

2、颜色(要下载两次,一次是被选中的,颜色要鲜艳些;第二次是未被选中的,颜色灰色些)

3、下载png就可以了


 步骤二、把这些图片放在imags里面,


步骤三 在app.json里面加入如下代码

"tabBar": {
  "list": [
    {
      "selectedIconPath": "images/index.png",
      "iconPath": "images/dindex.png",
      "pagePath": "pages/index/index",
      "text": "首页"
    },
    {
      "selectedIconPath": "images/news.png",
      "iconPath": "images/dnews.png",
      "pagePath": "pages/index/page",
      "text": "发布的项目"
    },
    {
      "selectedIconPath": "images/service.png",
      "iconPath": "images/dservice.png",
      "pagePath": "pages/index/service",
      "text": "服务类型"
    },
    {
      "selectedIconPath": "images/more.png",
      "iconPath": "images/dmore.png",
      "pagePath": "pages/index/more",
      "text": "更多"
    }
  ]
},

 


补充知识点


tabBar  指底部的 导航配置属性

color  未选择时 底部导航文字的颜色

selectedColor  选择时 底部导航文字的颜色

borderStyle  底部导航边框的样色(注意 这里如果没有写入样式 会导致 导航框上边框会出现默认的浅灰色线条)

list   导航配置数组

selectedIconPath 选中时 图标路径

iconPath 未选择时 图标路径

pagePath 页面访问地址

text  导航图标下方文字


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_37591637

请给我持续更新的动力~~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值