2017-06-18 68 views
0

我試圖在離子項目中實現https://ionicframework.com/docs/components/#datetime ,我成功地將它添加到我的模板上,問題是月份白天顯示在白色和背景中的年份也是白色,所以我們無法查看任何事情,如何解決這個問題?如何解決離子日期時間窗口顏色問題

的html代碼:

<ion-item> 
    <ion-label>Date of birth</ion-label> 
    <ion-datetime displayFormat="MMM DD YYYY" [(ngModel)]="event.month"></io$ 
</ion-item> 

.TS碼

public event = { 
month: '1990-02-19', 
} 

使用Mozilla Firefox結果視圖:

enter image description here

,但在谷歌沒有問題的Chrome

回答

1
在模板

試試這個:

<ion-item class="force-black-font"> 
     <ion-label>Date of birth</ion-label> 
     <ion-datetime displayFormat="MMM DD YYYY" [(ngModel)]="event.month"></ion-datetime> 
</ion-item> 

,然後添加到您的CSS:

.force-black-font { 
    color: black !important; 
}