android 键盘退回 慢,调用软键盘的速度很慢。。。
安卓机器上测试,每一次打开软件 ,第一次触发调用软键盘,要延迟2-3秒才会出来,,,然后再点的时候,就速度很快了,,这是什么原因??代码如下:var openSoftKeyboard = function() {if(mui.os.ios) {var webView = plus.webview.currentWebview().nativeInstanceObject();webView.plu
安卓机器上测试,每一次打开软件 ,第一次触发调用软键盘,要延迟2-3秒才会出来,,,
然后再点的时候,就速度很快了,,这是什么原因??
代码如下:
var openSoftKeyboard = function() {
if(mui.os.ios) {
var webView = plus.webview.currentWebview().nativeInstanceObject();
webView.plusCallMethod({
"setKeyboardDisplayRequiresUserAction": false
});
} else {
var webview = plus.android.currentWebview();
plus.android.importClass(webview);
webview.requestFocus();
var Context = plus.android.importClass("android.content.Context");
var InputMethodManager = plus.android.importClass("android.view.inputmethod.InputMethodManager");
var main = plus.android.runtimeMainActivity();
var imm = main.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);
}
}
var openplkuang=function(){
setTimeout(function() {
document.getElementById('bottommsg').style.display='block';
openSoftKeyboard();
document.getElementById("plkuang").focus();
}, 500);
}
更多推荐
所有评论(0)