我们正在部署一个离子应用程序,我们刚刚发现,当离子输入被聚焦时,键盘位于离子输入的顶部。我该怎么改变它呢?
我已经寻找了前八个小时的解决方案,但我所有的尝试都不起作用。
以下是我发现的一些页面:
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的顶部。当我输入的时候它没有显示出来。
发布于 2019-05-08 17:22:55
经过一些调查,问题实际上并不在键盘或其他方面,而只是出现在状态栏的插件上,导致应用程序被拉下,不知何故,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一样。
https://stackoverflow.com/questions/55317114
复制相似问题