Search code examples
.netmaui

How to display Lottie Json in specific Folder


I want to display my lottie file, but it is not working :

file Build Action Bundle resource:

      <skia:SKLottieView Grid.Row="0" 
    Source="resource://AppName.Resources.Raw.MyAudios.Effects.userlistening2.json" 
                                                       RepeatMode="Reverse" 
    HorizontalOptions="End" 
    RepeatCount="-1" 
    HeightRequest="30" 
    WidthRequest="30"/>

Solution

  • Since the json file is placed in the subfolder of the Resource/Raw folder, so you may try setting the source like,

    <skia:SKLottieView Grid.Row="0" 
    
        Source="MyAudios/Effects/userlistening2.json" 
    ...
    />
    

    The lottie animation will then display. (tested on all platforms).