当前位置:网站首页>Using tabbar in wechat applet
Using tabbar in wechat applet
2022-07-02 01:20:00 【richest_ qi】
List of articles
Prospect knowledge
front We learned : stay app.json To configure the applet globally ,app.json The content of the file is a JSON object , There are many properties , One of the common attributes is tabBar. If the applet is more than one tab application , You can go through tabBar Appoint tab Column performance , as well as tab The corresponding page displayed when switching .
tabBar The attribute value of is also an object , This object contains the following common properties :
color,tab The default color of the text on , Only hex colors... Are supported , Required .selectedColor,tab The color when the upper text is selected , Only hex colors... Are supported , Required .backgroundColor,tab Background color , Only hex colors... Are supported , Required .position,tabBar The location of , Only two values are supported :bottomandtop, The default value isbottom.list,tab A list of , Is an array , The minimum number of array elements 2 individual , most 5 individual . Each array element is an object , Contains the following attribute values :pathPath, Page path , Must be in pages In the definition of , Required .text,tab Text on , Required .iconPath, Picture path , Not required .icon Size limited to 40kb, The recommended size is 81px*81px, Network pictures are not supported . WhenpositionThe value istopwhen , No display icon.selectedIconPath, The path of the selected image , Not required .icon Size limited to 40kb, The recommended size is 81px*81px, Network pictures are not supported . Whenpositionbytopwhen , No display icon.
Applet project
pages Under the new Page:home( Home page )、camera( Taking pictures )、user( Personal center ).
- pages/home/
home.wxml、home.wxss、home.js、home.json - pages/camera/
camera.wxml、camera.wxss、camera.js、camera.json - pages/user/
user.wxml、user.wxss、user.js、user.json
Create a new folder under the project root directory :static,static I'm gonna go ahead and create a new folder :images,images I'm gonna go ahead and create a new folder :tabIcons,tabIcons Lower storage tabBar Icons to be used .
The main files involved in the code are :
- app.json
- pages/home/home.wxml
- pages/camera/camera.wxml
- pages/user/user.wxml

app.json
{
"pages": [
"pages/home/home",
"pages/camera/camera",
"pages/user/user"
],
"window": {
"navigationBarBackgroundColor": "#971a22",
"navigationBarTitleText": " home page ",
"navigationBarTextStyle": "white"
},
"tabBar": {
"color": "#000000",
"selectedColor": "#971a22",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/home/home",
"text": " Home page ",
"iconPath": "/static/images/tabIcons/home.png",
"selectedIconPath": "/static/images/tabIcons/home-fill.png"
},
{
"pagePath": "pages/camera/camera",
"text": " Taking pictures ",
"iconPath": "/static/images/tabIcons/camera.png",
"selectedIconPath": "/static/images/tabIcons/camera-fill.png"
},
{
"pagePath": "pages/user/user",
"text": " Personal center ",
"iconPath": "/static/images/tabIcons/user.png",
"selectedIconPath": "/static/images/tabIcons/user-fill.png"
}
]
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
pages/home/home.wxml
<view class="camera">
Here is Home Page
</view>
pages/camera/camera.wxml
<view class="camera">
Here is Camera Page
</view>
pages/user/user.wxml
<view class="camera">
Here is User Page
</view>

Related links
边栏推荐
- XMind思维导图
- cookie、session、tooken
- Global and Chinese markets for freight and logistics 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese market of picture archiving and communication system (PACS) 2022-2028: Research Report on technology, participants, trends, market size and share
- 8.8.4-PointersOnC-20220215
- Develop a simple login logic based on SSM
- Variables and constants of go language foundation
- Edge extraction edges based on Halcon learning_ image. Hdev routine
- ACM教程 - 快速排序(常规 + 尾递归 + 随机基准数)
- Basic usage of shell script
猜你喜欢

Learning note 3 -- Key Technologies of high-precision map (Part 1)

SSO single sign on implementation.
![[IVX junior engineer training course 10 papers to get certificates] 0708 news page production](/img/ad/a1cb672d2913b6befd6d8779c993ec.jpg)
[IVX junior engineer training course 10 papers to get certificates] 0708 news page production

Develop a simple login logic based on SSM
![[IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games](/img/69/44219af52baef20cedec3870147589.jpg)
[IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games

卷积神经网络(包含代码与相应图解)
![[eight sorts ①] insert sort (direct insert sort, Hill sort)](/img/8d/2c45a8fb582dabedcd2658cd7c54bc.png)
[eight sorts ①] insert sort (direct insert sort, Hill sort)
![[IVX junior engineer training course 10 papers] 06 database and services](/img/68/967566fc2f1d0b93ecd78bdb208b64.jpg)
[IVX junior engineer training course 10 papers] 06 database and services

The concept and application of Cartland number

With the acquisition of Xilinx, AMD is more than "walking on two legs" | Jiazi found
随机推荐
6-3漏洞利用-SSH环境搭建
Geek DIY open source solution sharing - digital amplitude frequency equalization power amplifier design (practical embedded electronic design works, comprehensive practice of software and hardware)
Global and Chinese market of safety detection systems 2022-2028: Research Report on technology, participants, trends, market size and share
Datawhale community blackboard newspaper (issue 1)
Mathematics - feelings -20220215
CEPH buffer yyds dry inventory
Docker安装Oracle_11g
cookie、session、tooken
Basic usage of shell script
卷积神经网络(包含代码与相应图解)
【八大排序④】归并排序、不基于比较的排序(计数排序、基数排序、桶排序)
Ubuntu20.04 PostgreSQL 14 installation configuration record
CTF daily question day45 sensor
【八大排序①】插入排序(直接插入排序、希尔排序)
DTL dephossite | prediction method of dephosphorylation sites based on Transfer Learning
[Chongqing Guangdong education] Tianshui Normal University universe exploration reference
Learning notes 25 - multi sensor front fusion technology
Variables and constants of go language foundation
关于ASP.NET CORE使用DateTime日期类型参数的一个小细节
Based on Simulink and FlightGear, the dynamic control of multi rotor UAV in equilibrium is modeled and simulated