Issue
I have this click event for my button:
private void BtnRecord_Clicked(object sender, EventArgs e)
{
if (BtnRecord.BackgroundColor == Color.Coral)
{
blue_record_lottie.Loop = true;
blue_record_lottie.AutoPlay = true;
blue_record_lottie.Play();
BtnRecord.BackgroundColor = Color.Red;
}
else if (BtnRecord.BackgroundColor == Color.Red)
{
BtnRecord.BackgroundColor = Color.Coral;
blue_record_lottie.AbortAnimation(blue_record_lottie.ToString());
blue_record_lottie.Loop = false;
blue_record_lottie.AutoPlay = false;
}
}
It just stops the animation of the button if the button color is red and when the animation is done playing. The animation will have to finish from the start of the animation to the end, and then it stops. I want it to immediately stop when I click the button.
Thanks in advance
Solution
If you want to make your Animation go back immediately to the very first state of the animation, you can do this:
Animation.PlayFrameSegment(0, 0);
This will play the very first Frame of your animation, after that, you can restart the animation like you would normally do.
Answered By - Ricardo Dias Morais
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.