当前位置:网站首页>微信小程序自适应性的自定义导航栏开发
微信小程序自适应性的自定义导航栏开发
2022-07-21 18:05:00 【CodingForAndroid】
自定义 customNavBarHeight
let res = wx.getSystemInfoSync();
let customNavBarHeight = res.statusBarHeight + res.screenWidth * 88 / 750; // 记得转换
页面正文高度 pageContantHeight
let model = res.model;
let isPhomeX = model.indexOf('iPhone X') > -1 || model.indexOf('iPhoneX') > -1 || model.indexOf('iPhone11') > -1;
let pageContantHeight = (isPhomeX ? res.screentHeight : res.windowHeight) - customNavBarHeight;
目前用机型测试结果这就是最好的适配方式了
边栏推荐
- Error in metadata publishing after EAS version upgrade
- Educational structure and calculated average years of education from 1989 to 2020
- Switch virtual environment in Jupiter notebook
- Environmental data set of listed companies: environmental performance schedule, emission schedule, resource consumption schedule and other indicator data
- 响应式布局——移动web像素
- 高频leetcode深搜部分:112. 路径总和
- The multi indicator data of 4000+ listed companies' provinces, cities and operations have been updated to 2022.1
- flyio 无感刷新token
- 排序方法:冒泡排序(使用数组实现一串数字的顺序排列(从大到小或从小到大))
- Vector Foundation
猜你喜欢
How to quickly develop a simple and practical MES system?
Tens of millions of data: from 2000 to 2019, enterprise registration data longitude and latitude, registration number and other multi indicator information of provinces, cities and counties in China
EAS Web BIM启动访问提示500错误
加速企业数据应用创新的核心能力——灵活性
高频leetcode深搜部分:98. 验证二叉搜索树
EAS BOS custom export (including excel style setting, multi tab export, export file directory verification and backup)
关于线程 thread (4)线程的交互
MySQL安裝配置-8.0版-Windows
Development environment EAS login license modification
Three implementation methods of Kingdee EAS unpacking deployment
随机推荐
关于线程 thread (3)线程的同步
开发环境 EAS登录 license 许可修改
数智融合加速驱动企业商业创新
CONDA common function record
Cross border trade terms
Environmental data set of listed companies: environmental performance schedule, emission schedule, resource consumption schedule and other indicator data
Literature: Axure (brief introduction)
让盒子居中且距离浏览器左右各100px做动画
Common properties of flex layout
排序方法--冒泡排序(使用数组实现一串数字的从大到小或从小到大排序)
High frequency leetcode deep search part: 98 Validate binary search tree
EAS Web BIM启动访问提示500错误
嵌入式之认识网卡phy自协商
知识分享|分享一些提升企业文档管理水平的方法
Vector Foundation
Review background management system practice: two packaging styles of request parameters
响应式布局——字体常用单位
实测 11 款远程视频会议软件,宅家工作也能如丝般顺滑
20201127 使用Markdown 画uml图,Graphviz 安装经历吐血整理
electron