Lottie animations
Describe how integrate Lottie animation components in MauiReactor
Last updated
Was this helpful?
Describe how integrate Lottie animation components in MauiReactor
Last updated
Was this helpful?
This article is based on the package which it's currently in preview.
Since Xamarin Forms, developers can integrate powerful animations inside their applications thanks to animation system implementation.
In .NET MAUI, you have the ability to play Lottie files using a relatively recent Skia-based implementation available inside package.
Using Lottie controls in MauiReactor is straightforward, it just requires you to add a package reference in csproj and to create a few scaffold classes inside your project.
First of all, add the reference to and MauiReactor Scaffold Generator packages:
The next step is to call the method UseSkiaSharp()
inside the MainProgram.cs file to enable SkiaSharp handlers.
After that, you have to create a few MauiReactor wrappers for the control SKLottieView which can load and play the animation:
Note that you can't just wrap the SKLottieView
but you have to generate wrappers also for the ancestors SKAnimatedSurfaceView
and SKSurfaceView
up to the TemplateView
class which is already wrapped by MauiReactor itself.
Finally, you can use the control inside your component:
This should be the final page with the animation running: