当前位置:网站首页>Wechat applet obtains the information of an element (height, width, etc.) and converts PX to rpx.
Wechat applet obtains the information of an element (height, width, etc.) and converts PX to rpx.
2022-07-03 00:28:00 【Pumpkin_ xiaoXuan】
<!-- Customize the bottom navigation bar Here we have to define class Below heel .select() Agreement -->
<tab-bar class="tabbar" :currentTabBar="0" :themeColors="themeColors"></tab-bar>
// Get the height of the bottom navigation bar
getTabBarHeight() {
let query = uni.createSelectorQuery().in(this);
query
.select(".tabbar") // there .tabbar Is the class name of the element
.boundingClientRect()
.exec((res) => {
let system = uni.getSystemInfoSync();
let tabBarHeightPx = res[0].height;
let rpx = system.windowWidth / 750;
this.tabBarHeightRpx = tabBarHeightPx / rpx
console.log('tabBarHeightRpx', this.tabBarHeightRpx);
})
},
// You need to wait while calling dom Call after rendering
this.$nextTick(() => {
this.getFixedItemInfo()
this.getTabBarHeight()
})// Here is to convert the obtained height into rpx, Because in different models px turn rpx It's inconsistent
let system = uni.getSystemInfoSync();
let tabBarHeightPx = res[0].height;
let rpx = system.windowWidth / 750;
this.tabBarHeightRpx = tabBarHeightPx / rpx边栏推荐
- Confluence的PDF导出中文文档异常显示问题解决
- Additional: token; (don't read until you finish writing...)
- How to write the design scheme of the thesis?
- maya渔屋建模
- logback配置文件
- NC17059 队列Q
- Bigder: how to deal with the bugs found in the 32/100 test if they are not bugs
- 【雅思阅读】王希伟阅读P1(阅读判断题)
- Seckill system design
- Leetcode skimming - game 280
猜你喜欢

sysdig分析容器系统调用

哪些软件可以整篇翻译英文论文?

Basic 10 of C language: array and pointer
![[MCU project training] eight way answering machine](/img/a3/6a50619cd16269bf485a4a273677aa.jpg)
[MCU project training] eight way answering machine

奥斯陆大学:Li Meng | 基于Swin-Transformer的深度强化学习

带角度的检测框 | 校准的深度特征用于目标检测(附实现源码)

Bigder:32/100 测试发现的bug开发认为不是bug怎么处理

Maya fishing house modeling

Multiprocess programming (II): Pipeline

论文的英文文献在哪找(除了知网)?
随机推荐
form表单实例化
JSON conversion tool class
Basic use of shell script
Automated defect analysis in electron microscopic images-论文阅读笔记
经济学外文文献在哪查?
[reading notes] phased summary of writing reading notes
监控容器运行时工具Falco
微信小程序获取某个元素的信息(高、宽等),并将px转换为rpx。
Markdown tutorial
Basic 10 of C language: array and pointer
Bigder: how to deal with the bugs found in the 32/100 test if they are not bugs
node_modules删不掉
Bloom filter
英文论文有具体的格式吗?
One of the reasons why setinterval timer does not take effect in ie: the callback is the arrow function
多进程编程(四):共享内存
NC24325 [USACO 2012 Mar S]Flowerpot
How do educators find foreign language references?
Interface difference test - diffy tool
Thinkadmin V6 arbitrary file read vulnerability (cve-2020-25540)