当前位置:网站首页>InfoQ 极客传媒 15 周年庆征文|position:fixed 虚拟按键触发后无法生效问题分析及解决方案探究
InfoQ 极客传媒 15 周年庆征文|position:fixed 虚拟按键触发后无法生效问题分析及解决方案探究
2022-06-12 10:42:00 【InfoQ】
一、前言
uni-app
.footer {
position: fixed;
width: 100%;
bottom: 0;
height: 120rpx;
justify-content: center;
align-items: center;
border-top: 1rpx solid #F0F0F0;
background: #ffffff;
}
二、原因分析及解决措施
CSShideFlag: true,
hideClass: 'hide'
<view class="footer" :class="hideFlag ? hideClass : ''">
<view @click="btnClick" class="btn" :class="{'btn-disable': btnDisabled}">提交</view>
</view>
onLoad() {
uni.onKeyboardHeightChange(res => {
// 虚拟按键隐藏
if (res.height === 0) {
this.hideFlag = true;
} else {
// 虚拟按键弹出
this.hideFlag = false;
}
})
},
CSS.hide {
position: fixed;
bottom: 0;
}
三、延伸阅读 uni-app版本检查弹窗去除

SDKHBuilderX- 在项目中找到
manifest.json配置文件;
- 点击源码视图;
- 找到
app-plus配置节点;
- 找到下面的
compatible字段(没有则添加),添加一段忽略提示的代码
"ignoreVersion": true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
"compatible" : {
"ignoreVersion": true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
},
四、拓展阅读
- 《Vue进阶(幺伍玖):动态样式设置》
边栏推荐
- Assign a specified amount to a specified number of people at random
- k53.第二章 基于二进制包安装kubernetes v1.22 --集群部署
- Stream as a return value in WCF - who disposes of it- Stream as a return value in WCF - who disposes it?
- PHP wechat red packet allocation logic
- Php中redis的keys问题
- 890. 查找和替换模式
- Pseudo static setting of access database in win2008 R2 iis7.5
- 对网络库协程的思考——读brpc有感
- Leetcode 2169. 得到 0 的操作数
- PHP: seven cattle cloud upload file
猜你喜欢

Stream as a return value in WCF - who disposes of it- Stream as a return value in WCF - who disposes it?

A snare - Cookie spoofing

M-arch (fanwai 13) gd32l233 evaluation - some music

Global and local existence of array, integer and character variables

Fiddler automatically saves the result of the specified request to a file

Leetcdoe 2037. Make each student have the minimum number of seat movements (yes, once)

M-arch (fanwai 12) gd32l233 evaluation -cau encryption and decryption (tease Xiaobian)

Tp6+memcached configuration

How to play the 2022 Taobao 618 Super Cat Games? What are the strategies for the Super Cat Games
![[machine learning] practice of logistic regression classification based on Iris data set](/img/c6/0233545d917691b8336f30707e4636.png)
[machine learning] practice of logistic regression classification based on Iris data set
随机推荐
A few secrets - a special day
JS pull-up loading more problems encountered in normal execution
How to refund the pre-sale deposit of JD 618 in 2022? Can JD 618 deposit be refunded?
Tp6+memcached configuration
PHP Apple purchase verification steps
Assign a specified amount to a specified number of people at random
Pagoda chevereto1.6.2 the latest version of stepping on the pit tutorial in Chinese
M-Arch(番外12)GD32L233评测-CAU加解密(捉弄下小编)
Zabbix 监控之LLD
Malicious code analysis practice - lab03-03 Exe basic dynamic analysis
PHP string encryption and decryption
The solution of Lenovo notebook ThinkPad t440 WiFi dropping all the time
A hundred secrets and a few secrets - Caesar encryption
VSCode代码调试技巧
Why check the @nonnull annotation at run time- Why @Nonnull annotation checked at runtime?
【机器学习】基于鸢尾花(iris)数据集的逻辑回归分类实践
Php中redis的keys问题
Get array median
MYSQL——内置函数
Using the echart plug-in to dynamically refresh charts in uview/uni-app