简体   繁体   English

Cordova StatusBar插件键盘重叠

[英]Cordova StatusBar Plugin Keyboard overlapping

I installed this package : https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-statusbar/ 我安装了此软件包: https : //cordova.apache.org/docs/en/latest/reference/cordova-plugin-statusbar/

to hide statusbar on android. 隐藏android上的状态栏。

I am using this command : StatusBar.hide(); 我正在使用以下命令: StatusBar.hide(); in first page's deviceReady event. 在首页的deviceReady事件中。

It works well, but when i try to focus some inputs, soft keyboard overlaps on input. 它运作良好,但是当我尝试着重输入时,软键盘会重叠在输入上。

If i remove hide command from my js, there is no problem. 如果我从我的js中删除hide命令,那没有问题。

Is this a bug ? 这是一个错误吗?

edit : 编辑:

  • I tried to change fullscreen preference to false in config.xml 我试图在config.xml中将全屏首选项更改为false
  • I tried to change android:windowSoftInputMode="adjustResize" to android:windowSoftInputMode="adjustPan" in AndroidManifest.xml. 我试图改变android:windowSoftInputMode="adjustResize"android:windowSoftInputMode="adjustPan"在AndroidManifest.xml中。

edit 2 : 编辑2:

I want to hide on IOS too. 我也想隐藏在IOS上。 But i tried for android. 但是我尝试了android。

Try adding these preferences in your config.xml 尝试在config.xml中添加这些首选项

<preference name="android-windowSoftInputMode" value="adjustResize" />
<preference name="fullscreen" value="false" />

edit : 编辑:

Another way you can try 您可以尝试的另一种方法

cordova plugin add cordova-plugin-keyboard

after that add show listener to it. 之后,向其中添加show listener。

window.addEventListener('keyboardDidShow', function () {
    // Describe your logic which will be run each time keyboard is shown.
    setTimeout(function() {
      document.activeElement.scrollIntoViewIfNeeded();
    }, 100);
});

note :- Tested in chrome and safari 注意:-经过镀铬和野生动物园测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM