ionic-framework - IONIC4背景图像在键盘打开时调整大小
问题描述
我正在尝试为我的登录页面设置背景图片,一些基本的东西。但是,当按下其中一个输入并显示键盘时,图像会被调整大小(小尺寸)
我的背景图像位于 div 标签中,我尝试将图像放在 ion-content 标签中,它解决了键盘问题,但随后图像放大了太多。我尝试使用 ion-view 标签,但随后出现以下错误
....错误:模板解析错误:'ion-view' 不是已知元素:
这是我的 html 代码(虽然是一些基本的东西)
<div class="bg">
<form #form="ngForm" (ngSubmit)="login(form)">
</form>
<ion-label ... ></ion-label>
</div>
这是我的 bg 课程:
.bg{
padding-bottom: 0 !important;
background-image: url('../../assets/lock.png') !important;
height: 100% !important;
width: 100% !important;
background-repeat: no-repeat;
background-image: cover !important;
background-size: cover !important;
background-position: center;
background-attachment: fixed;}
解决方案
尝试这个
ion-content {
background: url(images/bg.jpg) no-repeat center center fixed;
background-size: cover;
}
推荐阅读
- python - Pandas 数据框:如何删除以任意数字开头的行
- javascript - 简化和优化代码时的功能问题
- python - 拆垛时,出现错误“ValueError:索引包含重复条目,无法重塑”
- android - 当我在 ViewModelComponent 中使用 @Singleton 时,Hilt 如何保留实例
- qt - Qt android app build(clang ++没有这样的文件或目录错误:无法找到与应用程序同名的.so文件)
- node.js - 安装后“bash:gulp:找不到命令”
- reactjs - 打字稿类型绑定问题
- pandas - Pandas - 在 for 循环中获取同一用户的值之间的差异
- css - 在 Web 应用程序中使用新的自定义图标
- excel - 如何在 libre office basic 中使用模块?