Issue
I just updated to the latest version of Lottie; we are using Xamarin forms and now my app is crashing because it cannot find
- IsPlaying
- Loop
Can anyone tell me by what have they been replaced by?
Cannot find anything suggesting the replacement.
Solution
I have been playing around with lottie in XF a bit lately and I think I can help you.
- IsPlaying
I think this has been replaced with IsAnimating="{Binding IsAnimating}"
.
- Loop
There is no exact replacement for this. If you want an infinite loop you can use RepeatMode="Infinite"
and omit to set the RepeatCount
field.
If you want to play the animation for a specific number of times you can skip the RepeatMode
field and instead just set RepeatCount="1"
. This will repeat the animation one time. If you want it to only play one time and then stop you can skip the RepeatCount
field entirely or set it to RepeatCount="0"
The RepeatMode
field can probably be combined with the RepeatCount
field too but I haven't tested the different modes of that yet.
Here is a sample from my xaml. It loops animation.json infinite.
<forms:AnimationView
x:Name="animationView"
Animation="animation.json"
AutoPlay="True"
RepeatMode="Infinite"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand" />
Answered By - fefferoni
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.