繁体   English   中英

离子背景图片:中心无法在Android上运行

[英]Ionic Background image : center not working on Android

我正在升级我的Ionic App版本:

ionic: ionic-bower#1.2.4
ionic-platform-web-client": ^0.7.1
cordova: 6.1.1

升级后,背景图片未居中,我的CSS代码为:

body {
    background:url('../img/splash.png') rgb(227,227,213) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

而我的身体html仅是:

</head>
 <body ng-app="starter">
   <ion-spinner></ion-spinner>
</body>`

是离子的可能错误? 我究竟做错了什么?

我也有问题,找到了此链接

因此,这是如何在混合应用程序中为所有大小的设备添加背景的解决方案。因此,您必须将以下CSS添加到style.css中。 您必须为滚动内容添加相同的CSS,因为上述CSS仅适用于屏幕,而不适用于可滚动屏幕。

 .BackgroundImage{ background: url(image.jpg) no-repeat center center fixed; -webkit-background-size: contain; -moz-background-size: contain; -o-background-size: contain; background-size:contain; } .scroll-content{ background: url(image.jpg) no-repeat center center fixed; -webkit-background-size: contain; -moz-background-size: contain; -o-background-size: contain; background-size:contain; } 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM