如何更改 ion-toggle Angular-ionic3 上的背景颜色

问题描述

我想在选择切换时更改背景颜色,现在背景颜色是白色,我想将其更改为灰色。 这是我现在的离子开关

enter image description here

这就是我想要的

enter image description here

这是我的 .html 代码

 <ion-item>
     <ion-label no-padding>Allows phone calls?</ion-label>
     <ion-toggle [(ngModel)]="lead.isAllowCall" (ionChange)="change()" [disabled]="lead.oppdisable"></ion-toggle>
</ion-item>

这是我的 .scss 代码

    ion-toggle {
    --background: grey;
    --background-checked: #303E9F;
  
    --handle-background: #303E9F;
    --handle-background-checked: #grey;
  }

我试过那个代码,但它不能正常工作,你们能帮我解决吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)