中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
微信扫码分享
window.getLastWindow(getContext(this), (err: BusinessError, data) => { const errCode: number = err.code; if (errCode) { console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(err)); return; } windowClass = data; try { windowClass.on('keyboardHeightChange', (data) => { if (data > 0) { this.isKeyboardShow = true; console.info('监听keyboard抬起成功 '); } else { this.isKeyboardShow = false console.info('监听keyboard隐藏成功 '); } console.info('Succeeded in enabling the listener for keyboard height changes. Data: ' + JSON.stringify(data)); }); } catch (exception) { console.error('Failed to enable the listener for keyboard height changes. Cause: ' + JSON.stringify(exception)); }