عدم اجرای دو دستور repeatCount و repeatMode

پرسیده شده
فعالیت 1247 روز پیش
دیده شده 635 بار
1

درود و وقت بخیر به دوستان گلم

 

در پروژه این جلسه بجای استفاده از متد setFillAfter برای animationSet از setRepeatCount و setRepeatMode استفاده کردم ولی جالبه هیچکدوم روی animationSet جواب نمیدن.

 

علت چیه؟

 

RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

ScaleAnimation scaleAnimation = new ScaleAnimation(1, 3, 1, 3, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

AlphaAnimation alphaAnimation = new AlphaAnimation(1, 0);


AnimationSet animationSet=new AnimationSet(true);
   animationSet.addAnimation(rotateAnimation);
   animationSet.addAnimation(scaleAnimation);
   animationSet.addAnimation(alphaAnimation);
   animationSet.setDuration(1000);
   animationSet.setInterpolator(new AccelerateInterpolator());
 //animationSet.setFillAfter(true);
   animationSet.setRepeatCount(5);
   animationSet.setRepeatMode(Animation.REVERSE);
فایل پیوست

پژمان آزاد
پژمان آزاد

13 آذر 99

3
حذف شده

سلام و احترام

 

وقتی repeatMode و fillBefore  و fillAfter و duration بر روی AnimationSet ست کنیم این ویژگی ها بر روی تمامی فرزندان override میشوند پس روی خود AnimationSet تاثیری نداشته و روی فرزندان override خواهند شد.

نکته دوم ست کردن repeatCount و fillEnabled بر روی AnimationSet تاثیری ندارند

 

موفق و سالم باشید.

فایل پیوست

پوریا شفیعی

توسط

پوریا شفیعی

13 آذر 99