调用前:if(window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard){}
注:input标签自带功能,失焦-键盘隐藏;聚焦-键盘弹出
input-代码失焦 document.getElementById("inputId").blur();
input-代码聚焦 document.getElementById("inputId").focus();
cordova plugin add ionic-plugin-keyboard
方法
- cordova.plugins.Keyboard.hideKeyboardAccessoryBar
- cordova.plugins.Keyboard.close();
- cordova.plugins.Keyboard.disableScroll
- cordova.plugins.Keyboard.show();
属性
- cordova.plugins.Keyboard.isVisible
事件
- native.keyboardshow
- native.keyboardhide
window.addEventListener('native.keyboardshow',function(){
});
window.addEventListener('native.keyboardhide',function(){
});
网友评论