IONIC2背景图像在键盘打开时调整大小 [英] IONIC2 Background image is resized when keyboard is open

查看:160
本文介绍了IONIC2背景图像在键盘打开时调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在设置背景图片时使用ionic-2并将其大小(背景大小)设置为覆盖或100%100%,例如:

Using ionic-2 when a background image is set and it's size (background-size) is set to 'cover' or '100% 100%' such as:

background: url("../../img/bg.jpeg");
background-repeat: no-repeat;
background-size: cover;

打开键盘后的背景图片重新调整大小,如何避免这种情况? (即使键盘缩小了内容,背景图像大小也保持不变)

When the keyboard is opened the background image is resized, how can this be avoided? (So that the background image size remains the same even though the keyboard has shrunk the content)

推荐答案

使用正确的方法嵌入全屏背景图片:

Use the correct way to embed a full screen background image:

ion-content { 
  background: url(images/bg.jpg) no-repeat center center fixed; 
  background-size: cover;
} 

这篇关于IONIC2背景图像在键盘打开时调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆