我正在升级我的Ionic App版本:
read words uniques < <(
awk '
{
words += NF
for (i=1; i<=NF; i++) { unique[$i] }
}
END {
print words,length(unique)
}
' ${!#}
)
升级后背景图片不居中,我的CSS代码是:
ionic: ionic-bower#1.2.4
ionic-platform-web-client": ^0.7.1
cordova: 6.1.1
我的身体html只是:
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;
}
可能是Ionic的错误吗?我做错了什么?
答案 0 :(得分:2)
我也遇到了问题,发现了link
所以这里是如何在混合应用程序中为所有大小的设备添加背景的解决方案。所以你必须将以下内容添加到你的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;
}