版权声明:本文为博主原创文章,欢迎转载,转载请注明出处。 https://blog.csdn.net/luyu13141314/article/details/88417280
1、监听原生软键盘的动作
cordova plugin add ionic-plugin-keyboard //监听原生软键盘的动作
2、在index.js添加相关事件
// 监听键盘隐藏
window.addEventListener('native.keyboardshow',function (e) {
document.documentElement.style.height = 'auto';
})
// 监听键盘隐藏
window.addEventListener('native.keyboardhide',function (e) {
document.documentElement.style.height = '100%';
})