博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
微信小程序(六):伪tabbar的实现
阅读量:4107 次
发布时间:2019-05-25

本文共 2025 字,大约阅读时间需要 6 分钟。

微信小程序原生的tabbar一个项目只能有一个,我想要在多个页面都能使用不同的tabbar,就找到伪tabbar这种方法,通过点击元素实现页面跳转。

新建文件夹:

tabbarStudy.wxml

个人中心

tabbarStudy.wxss

/* 伪tabBar */.tabBar {  background-color: white;  border-top: 1rpx solid #a9b7b7;  color: "#a9b7b7";  width: 100%;  height: 100rpx;  position: fixed;  bottom: 0rpx;  display: flex;  flex-direction: row;  /* justify-content: space-around; */}.tabBar-left {  background-color: white;  color: "#a9b7b7";  width: 50%;  height: 100rpx;  display: flex;  flex-direction: column;}.tabBar-left-content-top {  background-color: white;  color: "#a9b7b7";  width: 100%;  height: 70rpx;  display: flex;  flex-direction: row;  justify-content: space-around;  margin-top: 10rpx;}.tabBar-left-content-img {  width: 50rpx;  height: 50rpx;}.tabBar-left-content-bottom {  background-color: white;  color: "#a9b7b7";  width: 100%;  height: 30rpx;  display: flex;  flex-direction: row;  justify-content: space-around;}.tabBar-left-content-label {  text-align: center;  font-size: 25rpx;  line-height: 25rpx;  height: 25rpx;  color: #a9b7b7;}.tabBar-right {  background-color: white;  color: "#a9b7b7";  width: 50%;  height: 100rpx;  display: flex;  flex-direction: column;}.tabBar-right-content-top {  background-color: white;  color: "#a9b7b7";  width: 100%;  height: 70rpx;  display: flex;  flex-direction: row;  justify-content: space-around;  margin-top: 10rpx;}.tabBar-right-content-img {  width: 50rpx;  height: 50rpx;}.tabBar-right-content-bottom {  background-color: white;  color: "#a9b7b7";  width: 100%;  height: 30rpx;  display: flex;  flex-direction: row;  justify-content: space-around;}.tabBar-right-content-label {  text-align: center;  font-size: 25rpx;  line-height: 25rpx;  height: 25rpx;  color: #a9b7b7;}

tabbarStudy.js

myCenter文件与上面的类似,不同之处

运行结果:

    

伪tabbar的不足:跳转的时候会出现闪烁 

转载地址:http://rlssi.baihongyu.com/

你可能感兴趣的文章
弱类型、强类型、动态类型、静态类型语言的区别是什么?
查看>>
Struts2技术内幕图书 转载
查看>>
Java异常分类
查看>>
项目中的jackson与json-lib使用比较
查看>>
Jackson Tree Model Example
查看>>
j2ee-验证码
查看>>
日志框架logj的使用
查看>>
js-高德地图规划路线
查看>>
常用js收集
查看>>
mydata97的日期控件
查看>>
如何防止sql注入
查看>>
maven多工程构建与打包
查看>>
springmvc传值
查看>>
Java 集合学习一 HashSet
查看>>
在Eclipse中查看Android源码
查看>>
Android-Socket登录实例
查看>>
Android使用webservice客户端实例
查看>>
层在页面中的定位
查看>>
[转]C语言printf
查看>>
C 语言 学习---获取文本框内容及字符串拼接
查看>>