殘疾人離子項目的背景色我試試這個:請離子2
.ion-item:disabled {
background-color:#ffffff !important;
}
但它沒有任何效果。我不希望它禁用時會顯示灰色背景,我會嘗試保留原始(白色)顏色。
代碼如下:
<ion-list>
<button ion-item *ngFor="let item of items [disabled]="!item.enabled" (click)="itemSelected(item)">
{{ item }}
</button>
</ion-list>
所以,如果item.enabled
是假的,背景變灰色,但我需要它的白色。
UPDATE:不需要任何補充CSS,容器的背景顏色是灰色的,也許是禁用的項目有透明或東西,但改變從灰色容器的顏色爲白色解決了這個問題。
檢查什麼渲染與'離子item',你可能有錯誤的選擇。你的模板看起來像你使用'ion-item'的地方? – devqon
這是[基本列表](https://ionicframework.com/docs/components/#lists)。 – ionic2dev