首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有没有办法让键盘不在离子输入之上?

有没有办法让键盘不在离子输入之上?
EN

Stack Overflow用户
提问于 2019-03-24 02:35:08
回答 1查看 572关注 0票数 0

我们正在部署一个离子应用程序,我们刚刚发现,当离子输入被聚焦时,键盘位于离子输入的顶部。我该怎么改变它呢?

我已经寻找了前八个小时的解决方案,但我所有的尝试都不起作用。

以下是我发现的一些页面:

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和相关页面。

代码语言:javascript
复制
<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的顶部。当我输入的时候它没有显示出来。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-08 17:22:55

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

描述

我使用StatusBar.overlaysWebView(true)将应用程序屏幕放在状态栏的顶部,这样它就可以处理颜色变化。

正如他们在opened issue on GitHub上所解释的那样,这样做正是问题所在。

解决方案

使用

代码语言:javascript
复制
cordova plugin add https://github.com/breautek/cordova-plugin-statusbar.git#issue-110-statusbar-overlay-keyboard-resize

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

但与此同时,问题应该已经被合并了,就像said in the same thread一样。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55317114

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档