首页 > 解决方案 > 如何像以前在 Ionic 3 中一样在 Ionic 4 中的 Loading 中使用 FontAwsome 图标?

问题描述

我有一项服务只是在屏幕上显示/隐藏加载。

我需要的是使用 Fontawsome 图标而不是 ionic 图标。

我试过了:

show(message ? : string) : void {
  this.isLoading = true;
  this.loader = this.loadingController.create({
    spinner: null,
    message: "<fa-icon icon='spinner' pulse='true' ></fa-icon>",
    translucent: true,
    showBackdrop: true,
    animated: true,
    keyboardClose: true
  });

  this.loader.then((a: any) => {
    a.present().then(() => {
      if (!this.isLoading) {
        a.dismiss().then(() => console.log('aborting...'));
      }
    });
  });
}

结果:
在此处输入图像描述

我能做些什么?

标签: angularionic4

解决方案


推荐阅读