当前位置:网站首页>Solution of vant tabbar blocking content
Solution of vant tabbar blocking content
2022-07-05 16:42:00 【Joy_ nine hundred and seventeen】
As we mentioned earlier , Use vant-tabbar To replace the native tabbar, But it is found in actual use , When tab After too much page content ,tabbar It will block the content at the bottom of the page
Directly above :
We will find that , Two buttons disappeared , from 2 Can be seen at , Right side of the screen scroll Over tabbar One column , The content is covered , It did slide to the bottom, but I couldn't see the button .
Why is this so ? Custom components of applets , It's through slot The content is injected into it and then rendered , and vant-tabbar Components are adopt cover-view In the form of Views overlaid on native components , It is not a reference component in the usual sense , Therefore, it is not a peer relationship with content elements .
At first I thought that since I was tabbar cover Live in an area , Then I'll find it tabbar Height of components , Then put the bottom element on top ?
Pictured above , Did find it ,vant The default is 50px, But the fixing effect is worrying , If you are interested, you can try . I guess it's because there is still a safe distance at the bottom of the component , So this height Not exactly equal to tabbar Occupation height of , Secondly, it will also be affected by the model .
During this period, I also tried another way , use scroll-view The label wraps the content , Then set a fixed height , such as 500px, In this way, the sliding content is not affected tabbar influence , Because the regions do not intersect . But it is also affected by the model .
Therefore, the final choice is to use the form of percentage to top up a distance , That is to say :
<view style="padding-bottom: 25%;"></view>
Look at the actual effect :
Most of the models tested are fairly ok. The disadvantage is that everyone has tabbar The page of , Need to add a blank view, Not very elegant . So I consider whether I can directly modify the custom components , stay slot Add directly before and after view, Or set it directly slot Style controls internal elements , But it didn't work , So stop .
Only try to jump to a new page and hide tabbar To avoid this . If you find a better way later , Updates will be synchronized , You are also welcome to tell me , thank ~
The full code is in github On , Ongoing update , welcome star Support :https://github.com/Joy917/signgo
边栏推荐
- 程序员如何提升自己的格局?
- 【 brosser le titre 】 chemise culturelle de l'usine d'oies
- "21 days proficient in typescript-3" - install and build a typescript development environment md
- 服务器的数据库连不上了2003,10060“Unknown error“【服务已起、防火墙已关、端口已开、netlent 端口不通】
- Apple has abandoned navigationview and used navigationstack and navigationsplitview to implement swiftui navigation
- Win11如何给应用换图标?Win11给应用换图标的方法
- yarn 常用命令
- 【深度学习】深度学习如何影响运筹学?
- EDI许可证和ICP经营性证有什么区别
- Record a 'very strange' troubleshooting process of cloud security group rules
猜你喜欢

How to set the WiFi password of the router on the computer

2020-2022两周年创作纪念日

Data Lake (XIV): spark and iceberg integrated query operation

Single merchant v4.4 has the same original intention and strength!

Android privacy sandbox developer preview 3: privacy, security and personalized experience

普洛斯数据中心发布DC Brain系统,科技赋能智慧化运营管理

解决CMakeList find_package找不到Qt5,找不到ECM

养不起真猫,就用代码吸猫 -Unity 粒子实现画猫咪

Pspnet | semantic segmentation and scene analysis

Win11提示无法安全下载软件怎么办?Win11无法安全下载软件
随机推荐
BS-XX-042 基于SSM实现人事管理系统
数据访问 - EntityFramework集成
Intel 13th generation Raptor Lake processor information exposure: more cores, larger cache
公司自用的国产API管理神器
程序员如何提升自己的格局?
Binary tree related OJ problems
Seaborn绘制11个柱状图
PHP 严格模式
Record a 'very strange' troubleshooting process of cloud security group rules
漫画:什么是八皇后问题?
自己要有自己的坚持
一键安装脚本实现快速部署GrayLog Server 4.2.10单机版
[echart] resize lodash to realize chart adaptation when window is zoomed
Raspberry pie 4B installation pytorch1.11
Fleet tutorial 09 basic introduction to navigationrail (tutorial includes source code)
漫画:什么是分布式事务?
Some cognitive thinking
Research and development efficiency measurement index composition and efficiency measurement methodology
Single merchant v4.4 has the same original intention and strength!
降本40%!Redis多租户集群的容器化实践