在微信小程序中或UniApp中自定义tabbar实现毛玻璃高斯模糊效果

backdrop-filter: blur(10px); 这一行代码表示将背景进行模糊处理,模糊程度为10像素。这会导致背景内容在这个元素后面呈现模糊效果。
background-color: rgb(255 255 255 / .32); 这一行代码表示设置元素的背景颜色为白色(RGB值为0, 0, 0),并且通过/符号后面的透明度值(32%不透明度)使背景半透明。这会导致背景显示为半透明的白色。

微信小程序

当tabbar背景颜色是黑色(#000000)的时候,设置background-color: rgb(0 0 0 / .32)

css 复制代码
/* 设置tabbar背景颜色 */
background-color: #000000 !important;
/* 毛玻璃 高斯模糊 */
backdrop-filter: blur(10px) !important;
background-color: rgb(0 0 0 / .32) !important;

当tabbar背景颜色是白色(#ffffff)的时候,设置background-color: rgb(255 255 255 / .32)

css 复制代码
/* 设置tabbar背景颜色 */
background-color: #000000 !important;
/* 毛玻璃 高斯模糊 */
backdrop-filter: blur(10px) !important;
background-color: rgb(255 255 255 / .32) !important;

UniApp

与微信小程序写法类似,但是background-color需要改成

css 复制代码
/* 设置tabbar背景颜色 */
background-color: #000000 !important;
/* 毛玻璃 高斯模糊 */
backdrop-filter: blur(10px) !important;
background-color: rgba(255,255,255,.32) !important;
相关推荐
2501_916007471 小时前
iOS 自动化上架的工具组合,在多平台环境中实现稳定发布
android·运维·ios·小程序·uni-app·自动化·iphone
1024小神1 小时前
uniapp项目中使用vue3和小程序组件父子通信
前端·小程序·uni-app
世洋Blog1 小时前
Unity开发微信小程序-避开新InputSystem有关坑
unity·微信小程序
爱敲代码的婷婷婷.1 小时前
微信小程序配置h5域名 / 普通二维码规则
微信小程序·小程序
漏刻有时1 小时前
微信小程序学习实录13:网络PDF文件的下载、本地缓存、预览、保存及主动转发
网络·学习·微信小程序
漏刻有时1 小时前
微信小程序学习实录12:wx.serviceMarket.invokeService接口OCR识别营业执照和银行卡
学习·微信小程序·ocr
说私域17 小时前
基于开源AI大模型的AI智能名片在S2B2C商城小程序维度表重复数据整理中的应用及效果研究
人工智能·小程序
云起SAAS21 小时前
图文小程序内无实质业务服务功能体验不完整解决小程序开源
小程序
毕设源码-朱学姐21 小时前
【开题答辩全过程】以 干洗店预约服务小程序为例,包含答辩的问题和答案
小程序
百锦再1 天前
Elements Plus 跨设备自适应显示问题综合解决方案
python·flutter·小程序·uni-app·k8s·tornado·net