Custom loader in ionic 5

Hello guys i was facing problem while adding custom loader.

Check out this solution.

For ionic 4+

this.myLoading = await this.loadingCtrl.create({ 
  spinner: null,
  message: '<ion-img src="assets/gif/loading.gif"></ion-img>',
  cssClass: 'custom-loading'
});
await this.myLoading.present();

Add class in theme/variables.scss

ion-loading.custom-loading {
  .loading-wrapper {
    background: transparent !important;
    box-shadow: none !important;
  }
}

Happy Coding…

Author Profile

PREM KUMAR
PREM KUMAR
Tech Lover , Open Src Dev , Dotnet Core, Ionic, Xamarin, Node, Angular2, Python, Opencv, AI, ML, Robotics, SignalR, Iot, Love Music, Cooking, Girls, Innovation.
Like
Like Love Haha Wow Sad Angry
1

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enable Notifications    Ok No thanks