<template>
<view class="content">
<input class="input" placeholder="测试键盘44431" />
<input class="input" placeholder="测试键盘44431"
@keyboardheightchange="showToast(`input.@keyboardheightchange: ${$event.detail.height}` )" />
</view>
</template>
<script>
export default {
onLoad() {
// 全局键盘高度监听事件
uni.onKeyboardHeightChange(res => this.showToast(`uni.onKeyboardHeightChange: ${res.height}`))
},
methods: {
showToast(title) {
uni.showToast({
title,
icon: 'none',
})
},
}
}
</script>
<style>
.input {
padding: 0 30rpx;
height: 100rpx;
background: rgba(0, 0, 0, 0.1);
margin-bottom: 30rpx;
}
</style>
- 发布:2021-03-17 12:21
- 更新:2021-03-17 12:22
- 阅读:876
【报Bug】配置 manifest 中 app-plus.softinput.mode 配置为 adjustPan 云端打包后,安卓中 onKeyboardHeightChange 事件失效
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: macOS Big Sur 11.2.3
HBuilderX类型: 正式
HBuilderX版本号: 3.1.4
手机系统: Android
手机系统版本号: Android 11
手机厂商: 一加
手机机型: 一加 7t pro
页面类型: nvue
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
云端打包后在安卓机器上发现键盘高度事件丢失
云端打包后在安卓机器上发现键盘高度事件丢失
预期结果:
键盘高度事件正常
键盘高度事件正常
实际结果:
键盘高度事件丢失
键盘高度事件丢失
bug描述:
配置 manifest 中 app-plus.softinput.mode 配置为 adjustPan 云端打包后,安卓中 onKeyboardHeightChange 事件失效
无论是 uni.onKeyboardHeightChange 还是 <input @keyboardheightchange />
本地链接真机调试没有问题,云端打包后,真机运行就有问题了