键盘弹起,隐藏问题——cordova

2017-03-13  本文已影响0人  AnneyLiu

调用前: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(){

});

上一篇下一篇

猜你喜欢

热点阅读