【问题标题】:How to add custom loader gif to Ionic V5如何将自定义加载器 gif 添加到 Ionic V5
【发布时间】:2020-01-07 10:38:09
【问题描述】:

我正在使用最新版本的 Ionic v5.0.0,并且我正在尝试在我的组件中添加一个自定义 gif 加载器。我尝试添加背景图片 url 并分配固定的高度和宽度。但是由于某些奇怪的原因,没有 css 属性生效。

这是我的 ts 代码:

 const loader = await this.loadingCtrl.create({
    spinner: null,
    cssClass: 'global-loader',
    duration:10000
  });

这是我的 home-results 组件 css:

.global-loader {

    background: url("/assets/img/loader.gif") no-repeat;
    background-size: 100% 100%;
    --height: 64px;
--max-height: 64px;
--max-width:64px;
--min-height:64px;
--min-width:64px;
--width:64px;
}

结果还是一样:

任何帮助将不胜感激 阿马尔

【问题讨论】:

标签: ionic-framework ionic-native


【解决方案1】:

在项目 src 文件夹的 global.css 文件中添加您的 .global-loader css 类

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-07
    • 2018-11-10
    相关资源
    最近更新 更多