uni-app 【报Bug】配置 manifest 中 app-plus.softinput.mode 配置为 adjustPan 云端打包后,安卓中 onKeyboardHeightChange 事件失效
uni-app 【报Bug】配置 manifest 中 app-plus.softinput.mode 配置为 adjustPan 云端打包后,安卓中 onKeyboardHeightChange 事件失效
开发环境 | 版本号 | 项目创建方式 |
---|---|---|
Mac | macOS Big Sur 11.2.3 | HBuilderX |
示例代码:
<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>更多关于uni-app 【报Bug】配置 manifest 中 app-plus.softinput.mode 配置为 adjustPan 云端打包后,安卓中 onKeyboardHeightChange 事件失效的实战教程也可以访问 https://www.itying.com/category-93-b0.html
2 回复
去掉 adjustPan 的配置后,重新云端打包安卓下键盘高度事件监听就恢复了
更多关于uni-app 【报Bug】配置 manifest 中 app-plus.softinput.mode 配置为 adjustPan 云端打包后,安卓中 onKeyboardHeightChange 事件失效的实战教程也可以访问 https://www.itying.com/category-93-b0.html