有没有办法让键盘不在 ion-input 之上?

Is there a way to make the keyboard not be on top of ion-input?

我们正在部署一个 Ionic 应用程序,我们刚刚发现,当 ion-input 获得焦点时,键盘位于 ion-input 的顶部。我应该如何改变它?

我花了八个小时寻找解决方案,但我尝试过的所有方法都没有用。

以下是我找到的一些页面:

https://www.bountysource.com/issues/35651824-keyboard-overlaps-the-text-input-when-the-input-is-placed-inside-an-ion-footer

https://github.com/EddyVerbruggen/cordova-plugin-native-keyboard

https://github.com/ionic-team/ionic-v3/issues/117 和相关页面。

<ion-list>
    ...
    <!--There are some element before, so that this one is at the bottom-->
    <ion-item>
        <ion-label position="floating">Description</ion-label>
        <ion-textarea type="text"
                      id="description"
                      [rows]="6"
                      [maxlength]="255"
                      name="description"
                      placeholder="Having more things to say ?"
                      [(ngModel)]="announce.description"
                      #description="ngModel"
                      required></ion-textarea>
    </ion-item>
    <div class="error-text" padding-start padding-end margin-bottom>
        <small>
            <span *ngIf="description.touched && description?.errors?.required">Required</span>
            <span *ngIf="description.touched && description?.errors?.maxlength">The max value 255</span>
        </small>
    </div>

</ion-list>

预计:

正如标题所说,我希望键盘出现在页脚的底部。

实际:

键盘在 ion-textarea 上方。而且我打字的时候不显示。

经过一些调查,问题实际上不在键盘或其他方面,而只是在导致应用程序被下拉的状态栏插件上,Cordova 不知道它的高度是多少屏幕是。

描述

我使用 StatusBar.overlaysWebView(true) 将应用程序屏幕置于状态栏顶部,以便它可以处理颜色变化。

这样做正是问题所在,正如他们在 opened issue on GitHub.

上所解释的那样

解决方案

使用

cordova plugin add https://github.com/breautek/cordova-plugin-statusbar.git#issue-110-statusbar-overlay-keyboard-resize

安装相同插件的另一个版本,即可解决问题。

但与此同时问题应该已经合并,如said in the same thread