Lottie.Forms - Load from EmbeddedResources

Viewed 671

I've got a AnimationView defined in AirBnb's Lottie Framework which should load a file placed inside my Resource folder inside my Xamarin.Forms Project (the portable one)

        <forms:AnimationView
            x:Name="AnimationView"
            Animation="SharpLibrary.Forms.Assets.Images.WineGlass.json"
            Loop="True"
            AutoPlay="True"
            VerticalOptions="FillAndExpand"
            HorizontalOptions="FillAndExpand" />

But it seems it cannot resolve the string in Animation property, so it will not display the animation. If I place the file into the Resource folder and say Animation="WineGlass.json" it works.

Is there a way to load it from EmbeddedResource, or is this not possible?

1 Answers

It worked with me at first you can put the json file at folder if you would or at the shared one

I put at folder renamed Image

Animation="Images.loading.json"

at the c# code put that

    animationView.AnimationSource = AnimationSource.EmbeddedResource;
Related