Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/190.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 当键盘打开时,IONIC2背景图像会调整大小_Android_Css_Background_Keyboard_Ionic2 - Fatal编程技术网

Android 当键盘打开时,IONIC2背景图像会调整大小

Android 当键盘打开时,IONIC2背景图像会调整大小,android,css,background,keyboard,ionic2,Android,Css,Background,Keyboard,Ionic2,当设置背景图像且其大小(背景大小)设置为“覆盖”或“100%100%”时,使用ionic-2,例如: background:url(“../../img/bg.jpeg”); 背景重复:无重复; 背景尺寸:封面经过长时间的搜索,没有找到解决方案,我决定使用angular-2的ngStyle开发一个,而这个解决方案实际上非常简单: 在page类中,创建shouldHeight成员: 导出类myPage{ shouldHeight=document.body.clientHeight+'px';

当设置背景图像且其大小(背景大小)设置为“覆盖”或“100%100%”时,使用ionic-2,例如:

background:url(“../../img/bg.jpeg”);
背景重复:无重复;

背景尺寸:封面经过长时间的搜索,没有找到解决方案,我决定使用angular-2的ngStyle开发一个,而这个解决方案实际上非常简单:

在page类中,创建shouldHeight成员:

导出类myPage{
shouldHeight=document.body.clientHeight+'px';
构造函数(专用navCtrl:NavController){
}

}
使用正确的方式嵌入全屏背景图像:

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

嗨@Dinana,尝试将背景位置固定,并将高度设置为100%。对我来说,它起作用了。如果你不需要调整BG图片的大小,它就起作用了,否则就不行了。。