2017-07-24 60 views
0

我有一個ion-header部分是這樣的:離子Navbar的背景圖像不出現 - 僅示出白色 - 離子3

<ion-header (swipeRight)="toProfile()"> 
    <ion-navbar #clickme class="itemadspace" [@slideDown]="downState" no-lines no-padding> 
    <h3 class="feedtitle">Stylist Feed</h3> 
    <div (tap)="loadPost()" class='pluscontainer'> 
     <ion-icon class='plussy' name="add"></ion-icon> 
    </div> 
    </ion-navbar> 

    ... 

</ion-header> 

ion-navbar的CSS是itemadspace類是:

.itemadspace { 
     z-index: 1; 
     position: fixed; 
     top: 0; 
     left: 0; 
     background-image: url('../../assets/tresemme.png'); 
     background-repeat: no-repeat; 
     background-size:cover; 
     text-align: center; 
    } 

否圖像顯示,ion-navbar組件的背景爲白色。任何想法如何讓背景圖片工作?

回答

1

而不是添加s類。你可以覆蓋主題。 您可以在底部的variable.scss中添加此代碼。

ion-header{ 
    ion-navbar{ 
     div.toolbar-background{ 
      background-image: url('../../assets/tresemme.png'); 
      background-repeat: no-repeat; 
      background-size:cover; 
      text-align: center; 
     } 
    } 
} 
+0

感謝您的迴應......我在'ion-navbar'中添加了一個'ion-item'作爲容器,並給它背景,它正在工作......你知道嗎如果你應該在'ion-list'之外使用'ion-item'? – ewizard

+0

是的,我想你可以在其他標籤中使用外部。順便說一下,如果你喜歡它,你可以像我一樣選擇我的答案。 thx .. – enRaiser

+0

我想我試過這個,它沒有爲我工作 – ewizard