2016-03-23 87 views
2

離子1.2我想顯示完整的背景圖像。 我有一個經典的項目結構:離子和離子視圖:顯示背景圖像

-hooks 
-platfroms 
-plugins 
-resources 
-scss 
-www 
    -css 
    -img 
    -js 
    -lib 
    -templates 
    ... 

我有一個HTML頁面

<ion-view id="login" hide-nav-bar="true"> 
    <ion-content padding="true" scroll="false"> 
    ... 
    ... 

其中:

#login { 
    background: #1c2627 url("../img/live.jpg") no-repeat center center fixed; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover; 
} 

在/www/css/style.css定義

用命令離子服務,背景顯示正確,但在離子視圖(執行命令離子上傳),背景不顯示。

有什麼問題?

+0

什麼是你的Android版本的兄弟姐妹和孩子宣佈一個div?它可能只是Ionic觀點中的一個錯誤,因爲它仍然處於測試階段。請嘗試在Android設備上。 –

回答

0

我有工作實現與確切的CSS你有一些額外的代碼。

嘗試增加

position: fixed 
top: 0 
z-index: -1 
height: 100% 
width: 100% 

請注意方法。

的選擇並不適用於離子含量,而是給在外面離子含量離子視圖

ion-view 
    ion-content 
    /ion-content 
    div 
    /div 
ion-view