离子 cordova 键盘隐藏输入

jgovgodb  于 2023-02-16  发布在  其他
关注(0)|答案(2)|浏览(149)

1.用离子键盘覆盖我的文本输入。
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"离子键盘版本

**离子信息:**这是我的离子信息

Ionic:

   ionic (Ionic CLI)             : 4.12.0
   Ionic Framework               : @ionic/angular 4.0.0-beta.15
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 0.8.9
   @angular/cli                  : 7.0.7
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms     : android 8.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.5.1, (and 10 other plugins)

System:

   NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10
iq0todco

iq0todco1#

添加此库

ionic cordova plugin add cordova-plugin-ionic-keyboard
 npm install --save @ionic-native/keyboard@4

使用下面的代码。

import { Keyboard } from '@ionic-native/keyboard/ngx';

constructor(private keyboard: Keyboard) { }

this.keyboard.show();

this.keyboard.hide();
jvidinwx

jvidinwx2#

对于电容器,将其添加到

"Keyboard": {
          "resize": "body",
          "style": "DARK",
          "resizeOnFullScreen": true
        }
      }

在电容器配置json下
您的最终配置应如下所示:

{
    "appId": "io.ionic.starter",
    "appName": "MyApp",
    "webDir": "www",
    "bundledWebRuntime": false,
    "plugins": {
        "Keyboard": {
          "resize": "body",
          "style": "DARK",
          "resizeOnFullScreen": true
        }
      }
}

相关问题