对于输入法应用,请参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-inputmethodengine-V5\#onkeyboardshowkeyboardhide对于非输入法应用,用监听键盘高度:window.getLastWindow(getContext(this)).then(lastWindow => { lastWindow.on('keyboardHeightChange', (size: number) => { console.warn(`...keyboardHeightChange: ${size}`); }) });参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-window-V5
对于输入法应用,请参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-inputmethodengine-V5\#onkeyboardshowkeyboardhide
对于非输入法应用,用监听键盘高度:
参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-window-V5