提交 22aeb244 编写于 作者: Q qiang

fix(App): 解决安卓设备 uni.onKeyboardHeightChange 首次触发键盘高度值为 0 的问题

上级 0bfd1536
......@@ -93,10 +93,15 @@ function initGlobalListeners () {
})
})
let keyboardHeightChange = 0
plus.globalEvent.addEventListener('KeyboardHeightChange', function (event) {
publish('onKeyboardHeightChange', {
height: event.height
})
// 安卓设备首次获取高度为 0
if (keyboardHeightChange !== event.height) {
keyboardHeightChange = event.height
publish('onKeyboardHeightChange', {
height: keyboardHeightChange
})
}
})
globalEvent.addEventListener('uistylechange', function (event) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册