【问题标题】:Ion Refresher color Icon does not change ionic 5 (stencil)Ion Refresher 颜色图标不会改变 ionic 5 (stencil)
【发布时间】:2021-04-20 10:18:07
【问题描述】:

如何在 ionic 5 中自定义 ionic refresher spinner 图标的样式? 我正在开发一个带有 lightmode 和 darkmode 的应用程序。在 lightmode 中,微调器以白色背景上的深灰色显示。到目前为止,一切都很好。但是如果我切换到暗模式,它会显示为白底白字。我试图改变颜色 f.e.与

<ion-refresher slot="fixed">
      <ion-refresher-content color="primary" refreshing-spinner="crescent">
</ion-refresher-content>

或 SCSS

    ion-refresher {
  ion-refresher-content {
      --color: red;
    }
  }

    ion-refresher {
  ion-refresher-content {
      color: red;
    }
  }

并将变量设置为

$refresher-icon-color: red;

非常感谢您的帮助。 谢谢!

【问题讨论】:

    标签: ionic-framework spinner darkmode


    【解决方案1】:

    你需要一些 CSS 来完成这项工作。我在下面添加了一个 CSS 代码,您可以在 global.css 文件中添加它,您可以从 ion-refresher-content color="primary" 中删除颜色选项

    //add this css code in your global.scss file which in your src folder
    ion-refresher.refresher-native ion-spinner{
        color: red!important;      
    }
    

    【讨论】:

      猜你喜欢
      • 2021-04-27
      • 2020-11-18
      • 1970-01-01
      • 1970-01-01
      • 2019-11-22
      • 2019-04-29
      • 2021-10-08
      • 1970-01-01
      • 2020-01-21
      相关资源
      最近更新 更多