项目里给一个TextView
设置放大和平移的动画,执行完以后,设置了View.GONE
。发现布局中还是能看到。getVisibility()
返回的是8,不可见。这是什么原因呢。
原因:设置了setFillAfter(true);
,具体为什么不知道。
解决办法:
tv.clearAniamtion();
tv.invalidate();
参考:http://blog.csdn.net/nijiayy/article/details/40683639
天蓬老师2017-04-17 15:23:39
Reason: setFillAfter(true);
is set, I don’t know the specific reason.
Solution:
tv.clearAniamtion();
tv.invalidate();
Reference: http://blog.csdn.net/nijiayy/article/details/40683639
黄舟2017-04-17 15:23:39
If you have code when you ask a question, it is best to post the main code
This way others can better handle your problem
ringa_lee2017-04-17 15:23:39
ViewAnimation essentially does not change the properties of the control. You can follow the method you mentioned, clear and then invalidate after the animation ends; you can also use propertyAnimation directly to implement animation.