Xamarin AnimationEnd事件仅触发一次

罗伯特·G

所以我有这几行代码尝试制作动画循环。不幸的是,它仅在事件每次停止时才触发一次。你能帮我么?

ImageView imgView1 = FindViewById<ImageView>(Resource.Id.falling_stars1);
ImageView imgView2 = FindViewById<ImageView>(Resource.Id.falling_stars2);

Android.Animation.ObjectAnimator animator1 = Android.Animation.ObjectAnimator.OfFloat(imgView1, "y", -700, 100);
Android.Animation.ObjectAnimator animator2 = Android.Animation.ObjectAnimator.OfFloat(imgView2, "y", 100, 900);

animator1.SetDuration(2000);
animator2.SetDuration(2000);
animator1.Start();
animator2.Start();

animator1.AnimationEnd += delegate
{
    animator1.Start();
};

animator2.AnimationEnd += delegate
{
    animator2.Start();
};
佐罗克

RepeatMode: Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite.

Android.Animation.ObjectAnimator animator1 = Android.Animation.ObjectAnimator.OfFloat(imgView1, "y", -700, 100);
animator1.SetDuration(2000);
animator1.RepeatCount = ValueAnimator.Infinite;
animator1.RepeatMode = ValueAnimatorRepeatMode.Restart;

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

.on('animationend webkitAnimationEnd oAnimationEnd')仅触发一次

来自分类Dev

“ onclick”事件仅触发一次

来自分类Dev

拖动事件仅触发一次

来自分类Dev

jQuery .change()事件仅触发一次

来自分类Dev

类似componentDidUpdate的事件,但仅触发一次

来自分类Dev

PropertyChanged事件触发器仅发生一次

来自分类Dev

仅触发一次热键/快捷事件

来自分类Dev

更改事件处理程序仅触发一次,jQuery

来自分类Dev

window.resize事件仅触发一次

来自分类Dev

仅触发一次jQuery滚动事件

来自分类Dev

仅触发一次jQuery mousemove事件

来自分类Dev

AngularJS-事件仅触发一次

来自分类Dev

iframe中的onload事件仅触发一次

来自分类Dev

jQuery Bootstrap Datepicker Click事件仅触发一次

来自分类Dev

仅触发一次的Symfony身份验证事件?

来自分类Dev

更改事件处理程序仅触发一次,jQuery

来自分类Dev

仅触发一次jQuery滚动事件

来自分类Dev

jQuery Mobile vclick事件仅触发一次

来自分类Dev

仅触发一次热键/快捷方式事件

来自分类Dev

jQuery animate仅通过keypress事件触发一次

来自分类Dev

Word加载项DocumentBeforeClose事件仅触发一次

来自分类Dev

Javascript onkeydown事件仅触发一次

来自分类Dev

onclick输入文件,仅触发一次onChange事件

来自分类Dev

Kendo Tabstrip单击事件仅触发一次

来自分类Dev

单击事件仅触发一次JQuery / bPopup

来自分类Dev

如何使由键触发的事件仅发生一次?

来自分类Dev

jQuery 单击事件仅触发一次

来自分类Dev

当事件仅发生一次时,JavaScript事件被触发两次

来自分类Dev

当事件仅发生一次时,JavaScript事件被触发两次