Supercharge your .NET MAUI tasks with Lottie animations! Believe it because the
magic wand on your app’s visuals. Due to Adobe After Results, Lottie
speaks a distinct language referred to as JSON, making animations a breeze. Meet
SkiaSharp, a Microsoft good friend that is helping Lottie shine in .NET MAUI, making your
app glance cool with out the complexity. Be informed the ropes in our beginner-friendly
information! Upload a splash of Lottie, sprinkle in some JSON magic, and watch your app
come to existence!
Most sensible benefits of Lottie Animations:
- Vector-based Adaptability: Lottie animations, being
vector-based, be certain that seamless scalability with out compromising answer.
- Decreased Record Measurement: In comparison to codecs like GIF or MP4,
Lottie recordsdata boast considerably smaller sizes whilst keeping up top-notch
Release Visible Studio 2022, and within the get started window click on Create a brand new
venture to create a brand new venture.
Within the Create a brand new venture window, choose MAUI within the All venture varieties
drop-down, choose the .NET MAUI App template, and click on the Subsequent button:
Within the configure your new venture window, title your venture, make a choice a
appropriate location for it, and click on the Subsequent button:
- Within the Additional info window, click on the Create button:
As soon as the venture is created, we will be able to ready to look the Android, iOS, Home windows
and different operating choices within the toolbar. Press the emulator or run button
to construct and run the app
Set up Plugin:
Library Requirement: SkiaSharp library is very important for
exhibiting Lottie animations.
Set up by way of NuGet: Download the SkiaSharp library through
looking for “SkiaSharp.Prolonged.UI.Maui” within the NuGet Package deal
Allow Prerelease: Be sure that the “Come with
prerelease” flag is enabled right through set up, as MAUI give a boost to is
lately in prerelease.
Person Interface Steering: Open the NuGet Package deal Supervisor
interface to facilitate the set up procedure.
Visible Affirmation: The library, as soon as searched, must
seem as “SkiaSharp.Prolonged.UI.Maui” within the NuGet interface.
<skia:SKLottieView RepeatCount="-1" RepeatMode="Opposite" Supply="walking_batman.json" HeightRequest="400" WidthRequest="400" />
<skia:SKLottieView>: That is the declaration of the SKLottieView, a specialised view for rendering Lottie animations the usage of the SkiaSharp library.
RepeatCount="-1": The RepeatCount characteristic determines how time and again the animation must repeat. A price of -1 way it’s going to repeat indefinitely.
RepeatMode="Opposite": The RepeatMode characteristic units the conduct of the animation when it repeats. On this case, “Opposite” way the animation will play in opposite each and every time it repeats.
Supply="walking_batman.json": Specifies the supply of the Lottie animation. On this instance, the animation is loaded from a record named “Woman.json” situated within the venture.
WidthRequest="400": Those attributes set the required top and width of the SKLottieView, on this case, each set to 400. This assets is essential to visualise Lottie animation.
This code necessarily integrates a Lottie animation (from the “walking_batman.json” record) into your Xamarin.Bureaucracy utility, configuring its repeat conduct and dimensions. Modify those attributes in accordance with your particular animation and format necessities.
GitHub. If you happen to
have any doubts, be happy to publish a remark. If you happen to preferred this newsletter, and
it comes in handy to you, do like, proportion the item & famous person the repository on