前言
提示:这里可以添加本文要记录的大概内容:
例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。
提示:以下是本篇文章正文内容,下面案例可供参考
一、tabBar是什么?
示例:tabBar是应用最下边的导航栏
二、使用步骤
1.在app.json中添加以下代码
代码如下(示例):
"tabBar": {
"list": [
{
"iconPath": "/static/images/weather01.png",
//导入图片,未被点击的
"pagePath": "pages/weather/weather",
"text": "天气",
"selectedIconPath": "/static/images/weather02.png"
//导入图片,被点击的
},
{
"iconPath": "/static/images/animal03.png",
"pagePath": "pages/index/index",
"text": "宠物",
"selectedIconPath": "/static/images/animal04.png"
},
{
"iconPath": "/static/images/xinwen01.png",
"pagePath": "pages/new/index01/index01",
"text": "新闻",
"selectedIconPath": "/static/images/xinwen02.png"
},
{
"iconPath": "/static/images/profile.png",
"pagePath": "pages/geren/geren",
"text": "我的",
"selectedIconPath": "/static/images/profile-actived.png"
}
]
},
添加如下:
2.效果如下
三.遇到问题及解决方案
问题
应用启动时:无法跳转到登录界面
方案
将代码直接添加到pages‘第一个’(图一),然后底下的tabber不能有:welcome界面(图二)
图一:
图二:
总结
底部标题栏比较经常使用,使用方法很简单,注意对应的页面跳转
附上:微信开发者文档