当前位置:网站首页>tabbar的设置
tabbar的设置
2022-07-03 06:01:00 【兰颜】
问:tabbar是做什么的?
答:底部导航
问:有哪些部分组成
答:
"pagePath": "pages/index/index" 页面路径
- "text": "首页" 页面名称
"iconPath":"/images/tabbar/home.png" 没有选中时,展示的图片
"selectedIconPath":"/images/tabbar/home-active.png" 选中时的图片
如图

1. 遇到的第一个问题就是tabbar的设置
文档链接1 uni-app官网
https://uniapp.dcloud.net.cn/collocation/pages.html#tabbar
文档链接 2
uni.setTabBarItem(OBJECT) | uni-app官网
https://uniapp.dcloud.io/api/ui/tabbar.html
2. 把你需要用到的tabbar的图片放到'“static”文件夹里面
3. 按照文档提示的例子,添加我们自己的tabbar(因为我这里已经有写完的百度小程序tabbar,看了一下代码差不多是一样的,所以就直接复制过来)
图1

代码 (其中的xxx替换成自己的页面文件夹名称和页面名称)
"tabBar": {
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home-active.png"
},
{
"pagePath": "pages/xxx/xxx",
"text": "xxx",
"iconPath": "static/images/tabbar/counrty.png",
"selectedIconPath": "static/images/tabbar/country-active.png"
},
{
"pagePath": "pages/xxx/xxx",
"text": "xxx",
"iconPath": "static/images/tabbar/news.png",
"selectedIconPath": "static/images/tabbar/news-active.png"
},
{
"pagePath": "pages/xxx/xxx",
"text": "xxx",
"iconPath": "static/images/tabbar/ask.png",
"selectedIconPath": "static//images/tabbar/ask-active.png"
},
{
"pagePath": "pages/xxx/xxx",
"text": "xxx",
"iconPath": "static/images/tabbar/me.png",
"selectedIconPath": "static//images/tabbar/me-active.png"
}
],
"backgroundColor": "#ffffff",
"borderStyle": "white",
"color": "#000",
"selectedColor": "#6495ED"
},这样弄完之后,你的项目就拥有了一个底部导航啦
这里多说一些别的,

- pages是配置页面路径的,一组花括号代表了一个页面的配置
- path 是页面在项目中的路径
- navigationBarTitleText 是页面的标题
边栏推荐
- Detailed explanation of contextclassloader
- Kubernetes notes (I) kubernetes cluster architecture
- Convolution operation in convolution neural network CNN
- 【一起上水硕系列】Day 10
- Qt读写Excel--QXlsx插入图表5
- Kubernetes notes (III) controller
- Solve the 1251 client does not support authentication protocol error of Navicat for MySQL connection MySQL 8.0.11
- PMP笔记记录
- Code generator - single table query crud - generator
- Skywalking8.7 source code analysis (II): Custom agent, service loading, witness component version identification, transform workflow
猜你喜欢

Life is a process of continuous learning

智牛股项目--05

Redis cannot connect remotely.

Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation

Solve the 1251 client does not support authentication protocol error of Navicat for MySQL connection MySQL 8.0.11

理解 YOLOV1 第一篇 预测阶段

Understand one-way hash function
![[teacher Zhao Yuqiang] Alibaba cloud big data ACP certified Alibaba big data product system](/img/cc/5509b62756dddc6e5d4facbc6a7c5f.jpg)
[teacher Zhao Yuqiang] Alibaba cloud big data ACP certified Alibaba big data product system

SVN分支管理

Es remote cluster configuration and cross cluster search
随机推荐
Simple solution of small up main lottery in station B
Core principles and source code analysis of disruptor
1. 兩數之和
【一起上水硕系列】Day 7 内容+Day8
[teacher Zhao Yuqiang] MySQL flashback
SVN分支管理
Apache+php+mysql environment construction is super detailed!!!
Alibaba cloud Alipay sandbox payment
一起上水硕系列】Day 9
chromedriver对应版本下载
Final review (Day7)
项目总结--2(Jsoup的基本使用)
[Zhao Yuqiang] deploy kubernetes cluster with binary package
Understand the first prediction stage of yolov1
Synthetic keyword and NBAC mechanism
1. Sum of two numbers
NG Textarea-auto-resize
【一起上水硕系列】Day 10
Redis encountered noauth authentication required
Today, many CTOs were killed because they didn't achieve business
https://uniapp.dcloud.net.cn/collocation/pages.html#tabbar