在 onClickListener 上,我在 textView(图标)上开始动画
Animation anim = AnimationUtils
.loadAnimation(activity.getBaseContext(), R.anim.rotate_refresh);
icon.startAnimation(anim);
再次点击时,我想检查图标是否在动画(旋转),保持这种状态,否则再次开始动画。
我想知道如何检查动画中的textview?
最佳答案
也许试试这样的东西
Animation animation = icon.getAnimation();
if(animation != null && animation.hasStarted() && !animation.hasEnded()){
//do what you need to do if animating
}
else{
//start animation again
}
关于android - 如何知道 TextView 是否在动画中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29250714/