简体   繁体   English

动画在ImageView中具有延迟android

[英]animation with delay android in ImageView

I'm trying to implement animation with delay in android, but in my case the imageview is infinitely rotating, because i don't know how can i dynamically stop and start it. 我正在尝试在android中延迟实现动画,但是在我的情况下,imageview会无限旋转,因为我不知道如何动态停止和启动它。

final RotateAnimation anim = new RotateAnimation(0f, 350f, 15f, 15f);
        anim.setInterpolator(new LinearInterpolator());
        anim.setRepeatCount(Animation.INFINITE);
        anim.setDuration(700);
        imageView.startAnimation(anim);

Take a look at setRepeatCount arguments and setStartOffset method. 看一下setRepeatCount参数和setStartOffset方法。 First one allows you to limit repeated animation, second one - introduce a time delay. 第一个允许您限制重复的动画,第二个-引入时间延迟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM