0
所以我有這幾行代碼,我嘗試做一個動畫循環。不幸的是,只有在事件停止時才觸發一次。你能幫我麼?Xamarin AnimationEnd觸發事件只有一次
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();
};
添加的你在這裏提出更改的說明。 –
我可以編輯動畫以便它結束並突然出現星星嗎?如果有這樣做的另一種方式? –
你是什麼意思,突然結束並開始?你想讓它停止中間動作嗎? – Zroq