2016-05-03 29 views
1

我升級我的離子應用程序版本:離子背景圖像:中心不工作在Android

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>` 

爲離子的一個可能的錯誤?我究竟做錯了什麼?

+0

是的,你需要給背景圖像類.scroll內容。 – Atula

回答

2

我有一個問題,它太,發現這個link

因此,這裏是如何添加背景混合動力裝置的全尺寸application.So你有以下的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; 
 
}

+0

它的工作原理!謝謝! :) –