gpt4 book ai didi

ios - 在 Ionic iOS 应用程序中打开键盘会将背景图像向上移动

转载 作者:行者123 更新时间:2023-11-29 05:31:59 25 4
gpt4 key购买 nike

在 iOS 中打开键盘时,我的 ionic 内容的背景图像会向上移动。我怎样才能阻止这个?我使用的是 Capacitor 而不是 Cordova。

enter image description here

enter image description here

<ion-content>
<div class="content">

.content {
width: 100%;
height: 100%;
padding: 0;
position: relative;
background: url("./../../../assets/img/login-bg.jpg") no-repeat fixed center;
background-size: cover !important;
background-attachment: fixed;
background-repeat: no-repeat;
background-position: left;
}

我已经在 AndroidManifest.xml 中找到了适用于 Android 的解决方案:

<activity android:windowSoftInputMode="adjustPan" />

最佳答案

对于iOS,将其添加到capacitor.config.json

{
"plugins": {
"Keyboard": {
"resize": "body",
"style": "dark"
}
}
}

请参阅此处的文档:https://capacitor.ionicframework.com/docs/apis/keyboard

对于安卓:将其添加到 AndroidManifest.xml:

<activity android:windowSoftInputMode="adjustPan" />

关于ios - 在 Ionic iOS 应用程序中打开键盘会将背景图像向上移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57454040/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com