微信小程序tabBar边框加|上阴影

1.将tabbar的borderStyle属性设置为white

2.在app.wxss中

page::after{
  content: '';
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height:1rpx;
  background: transparent;
  box-shadow:0rpx -2rpx 20rpx 2rpx rgba(165,165,165,0.34);
  z-index: 9999;
}

3.有不需要阴影的页面,在当前页的wxss中取消

page::before{
    height: 0rpx;
}

或者将步骤2写在需要阴影页面的wxss中就不需要步骤3了

参考链接小Tip:小程序如何自定义tabbar上边框的颜色 - 简书 (jianshu.com)

猜你喜欢

转载自blog.csdn.net/kxmzl/article/details/127571329