Ionic Angular键盘

huangapple go评论53阅读模式
英文:

Ionic Angular Keyboard

问题

我在关闭键盘后遇到了一个问题,内容的实际大小没有恢复正常。

我检查了日志,没有看到错误,我在输入金额时使用了一个组件。
PS. 我将输入金额放在一个组件中,因为我在不同的页面中使用它。

main.page.html - 代码的一部分,不是全部,不用贴得太长

<ion-content>
  <app-enter-amount></app-enter-amount>
</ion-content>
<ion-footer>
  <ion-button>确认</ion-button>
  <ion-button>取消</ion-button>
</ion-footer>

enter.amount.html - 代码的一部分,不是全部,不用贴得太长
<ion-input type="tel" inputmode="numeric"></ion-input>

Ionic Angular键盘
Ionic Angular键盘
Ionic Angular键盘

我希望在关闭键盘后,内容的大小会恢复正常。
我尝试了很多在互联网上找到的方法,但都没有起作用。如果我无法解决这个问题,我的最后选择是不使用组件,在每个页面中放入输入金额的HTML和功能。
如果我的问题有遗漏或者你们想要了解更多,请告诉我,非常感谢。

英文:

I'm having a problem after closing the keyboard the actual size of the content is not back to normal.
I checked the logs and see no errors, I'm using a component for my enter amount input.
PS. I put the enter amount in a component because I am using it in different pages.

main.page.html - part of the code not all to long to post

&lt;ion-content&gt;
 &lt;app-enter-amount&gt;&lt;/app-enter-amount&gt;
&lt;/ion-content&gt;
&lt;ion-footer&gt;
 &lt;ion-button&gt;Confirm&lt;/ion-button&gt;
 &lt;ion-button&gt;Cancel&lt;/ion-button&gt;
&lt;/ion-footer&gt;

enter.amount.html - part of the code not all to long to post
&lt;ion-input type=&quot;tel&quot; inputmode=&quot;numeric&quot;&gt;&lt;/ion-input&gt;

Ionic Angular键盘
Ionic Angular键盘
Ionic Angular键盘

I'm expecting that after closing the keyboard the content size will back to normal.
I tried so many things I found in the internet but nothing works. My last option is to not use component and put enter amount html and functions in every pages, If I cant figure this out.
If there is something missing in my question or you guys want to know please let me know, Thank you very much.

答案1

得分: 1

在经过了很多小时的调试后,我刚刚发现,我的输入框中的这个CSS样式 position:fixed 就是原因,就好像在键盘弹出时有一些冲突。

英文:

after of so many hours of debugging I just found out that this css style position:fixed in my input is the reason, its like having some conflict when the keyboard pops up & out.

huangapple
  • 本文由 发表于 2023年3月7日 02:55:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75654759.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定