英文:
Play animation backwards
问题
我在我的AnimationView上添加了点击事件,我试图在第一次点击时播放动画,在第二次点击时倒放动画。
要实现这个效果,最好的方式是什么?
Com.Airbnb.Xamarin.Forms.Lottie 4.1.0
Xamarin.Forms 5.0.0.2291
英文:
I added click event on my AnimationView and I'm trying to play the animation with the first click and play the animation backwards with the second one.
Which would be the best way to achieve it?
Com.Airbnb.Xamarin.Forms.Lottie 4.1.0
Xamarin.Forms 5.0.0.2291
答案1
得分: 0
正如Andrew建议的那样,诀窍是调整正负动画速度。
if (!animationShowing)
{
this.menuView.Speed = 3;
this.menuView.PlayMinAndMaxFrame(0, 20);
}
else
{
this.menuView.Speed = -3;
this.menuView.PlayAnimation();
}
英文:
As Andrew suggested, the trick was to play with positive/negative animation speed.
if (!animationShowing)
{
this.menuView.Speed = 3;
this.menuView.PlayMinAndMaxFrame(0, 20);
}
else
{
this.menuView.Speed = -3;
this.menuView.PlayAnimation();
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论