【问题标题】:selected ion-input border is moving up and down when the keyboard enters to the screen当键盘进入屏幕时,选定的离子输入边框上下移动
【发布时间】:2023-03-02 23:04:01
【问题描述】:

我正在使用ionic3。当设备键盘进入屏幕时,离子内容中所选离子输入的边框正在移动,如下所示。

我的 .html 就像,

<ion-list>
  <ion-card class="xxx-card">
    <ion-item>
      <ion-input class="xxx-card" [disabled]="invoice.isChecked === true" text-center type="number" [(ngModel)]="invoice.paymentValue"
        (ngModelChange)="paymentValueCange($event,invoice,i)" name="paymentValue"></ion-input>
    </ion-item>
  </ion-card>
</ion-list>

还有.css

.xxx-card{
border: 2px solid #00BB84;
margin:10px auto;
border-radius: 10px !important;
}

我需要做的就是在键盘进入设备屏幕时停止离子输入的移动。等待您的建议。谢谢!

【问题讨论】:

    标签: javascript css ionic-framework sass ionic3


    【解决方案1】:

    我不确定它是否有效,但请尝试一下。

    在您的平台文件夹中

    platform => android => AndroidMainfest.xml 文件打开它。

     <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
    

    检查上面的like和android:windowSoftInputMode="adjustResize"把这个改成这个android:windowSoftInputMode="adjustPan"

    构建它并测试它请让我知道任何问题

    【讨论】:

    • 仍然有同样的问题
    猜你喜欢
    • 1970-01-01
    • 2017-03-30
    • 1970-01-01
    • 2017-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多