微信小程序-项目案例 (二)配置 tabBar
来源:互联网 发布:教程网网站源码php 编辑:程序博客网 时间:2024/05/17 06:16
如果小程序是一个多 tab 应用(客户端窗口的底部或顶部有 tab 栏可以切换页面),可以通过 tabBar 配置项指定 tab 栏的表现,以及 tab 切换时显示的对应页面。
Tip:
- 当设置 position 为 top 时,将不会显示 icon
- tabBar 中的 list 是一个数组,只能配置最少2个、最多5个 tab,tab 按数组的顺序排序。
属性说明:
其中 list 接受一个数组,数组中的每个项都是一个对象,其属性值如下:
我项目做了一个简单配置 (app.json文件里), 大家可以参考下:
"tabBar": { "borderStyle": "white", "position": "bottom", "selectedColor": "blue", "list": [ { "pagePath": "pages/home/home", "text": "阅读", "iconPath": "images/icon/yuedu.png", "selectedIconPath": "images/icon/yuedu_hl.png" }, { "pagePath": "pages/music/music", "text": "音乐", "iconPath": "images/icon/dianying.png", "selectedIconPath": "images/icon/dianying_hl.png" }, { "pagePath": "pages/video/video", "text": "电影", "iconPath": "images/icon/dianying.png", "selectedIconPath": "images/icon/dianying_hl.png" } ] }
如图:
ps : 配置 tabBar 的 icon 图标一定是相对路径 ,拒绝写绝对路径 !
阅读全文
0 0
- 微信小程序-项目案例 (二)配置 tabBar
- 微信小程序tabBar使用
- 微信小程序之tabbar
- 微信小程序Tabbar
- 微信小程序隐藏tabBar
- 微信小程序 tabBar
- 微信小程序tabBar
- 微信小程序tabBar设置
- 微信小程序自定义tabbar
- 小程序底部tabBar导航配置(app.json)
- 微信小程序环境搭建-项目案例 (一)启动页
- 微信小程序tabBar显示问题
- 微信小程序tabbar不显示
- 微信小程序标签栏tabBar
- 微信小程序tabBar显示问题
- 微信小程序入门之tabBar
- 微信小程序底部导航Tabbar
- 微信小程序之tabbar切卡
- ubuntu开机自动挂载硬盘分区
- 守护进程中/dev/null
- [转载]字符编码
- Legal or Not
- 1053. 住房空置率 (20)
- 微信小程序-项目案例 (二)配置 tabBar
- 超分辨率(super-resolution)VS解模糊(deblur)
- 用java编写两个矩阵相乘
- [J2SE]个人便捷英汉词典
- 程序设计实习MOOC / 程序设计与算法(一)第三周测验(2017冬季)4:苹果和虫子2
- python基础6:面向对象1
- Android 音视频录制概述
- c#调用C/C++ DLL,传入指针数组(指针指向自定的结构体)
- explain type 类型