1. 效果图 2. 对于底部导航栏,小程序上给出的文档要求里面的item最少2个,最多五个。对了,在项目中找到这个文件,记得,底部ToolBar要在这个里面写: 3. 编写代码:{ “pages”:[ “pages/index/index”, “pages/logs/logs”, “pages/mine/mine” ], “window”:{ “backgroundTextStyle”:”light”, “navigationBarBackgroundColor”: “#fff”, “navigationBarTitleText”: “首页”, “navigationBarTextStyle”:”black” }, “tabBar”: { “color”: “#a9b7b7”, “selectedColor”: “#11cd6e”, “borderStyle”: “black” , “list”: [{ “selectedIconPath”: “images/icon_consult_press.png”, “iconPath”: “images/icon_consult.png”, “pagePath”: “pages/index/index”, “text”: “首页” }, { “selectedIconPath”: “images/icon_invest_press.png”, “iconPath”: “images/icon_invest.png”, “pagePath”: “pages/logs/logs”, “text”: “一元投” },{ “selectedIconPath”: “images/icon_mine_press.png”, “iconPath”: “images/icon_mine.png”, “pagePath”: “pages/mine/mine”, “text”: “我的” } ] } } 这里我先解释一下这些属性是什么意思:tabBar 指底部的 导航配置属性color 未选择时 底部导航文字的颜色selectedColor 选择时 底部导航文字的颜色borderStyle 底部导航边框的样色(注意 这里如果没有写入样式 会导致 导航框上边框会出现默认的浅灰色线条)list 导航配置数组selectedIconPath 选中时 图标路径iconPath 未选择时 图标路径pagePath 页面访问地址text 导航图标下方文字 这里需要注意一些小问题:1、每个页面的json文件都不能去掉navigationBarTitleText这个属性。否则会报错 “pages”:[ “pages/index/index”, “pages/logs/logs”, “pages/mine/mine” ],这个页面的注册一定要注意,第一个一定是要是最先显示的,否则会出现底部导航看不到。
微信小程序开发–底部导航Tabbar
未经允许不得转载:E企盈小程序开发-热线:4006-838-530 » 微信小程序开发–底部导航Tabbar
最新评论
不错的小程序案例
优秀的团队,不错的服务!
讲的很好
主播长的帅气
好系统好服务
优秀的团队
好服务,值得信赖
不错的服务