项目里给一个TextView设置放大和平移的动画,执行完以后,设置了View.GONE。发现布局中还是能看到。getVisibility()返回的是8,不可见。这是什么原因呢。
TextView
View.GONE
getVisibility()
原因:设置了setFillAfter(true);,具体为什么不知道。解决办法:
setFillAfter(true);
tv.clearAniamtion(); tv.invalidate();
参考:http://blog.csdn.net/nijiayy/article/details/40683639
人生最曼妙的风景,竟是内心的淡定与从容!
Reason: setFillAfter(true); is set, I don’t know the specific reason. Solution:
Reference: http://blog.csdn.net/nijiayy/article/details/40683639
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
Is the moving position wrong?
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.
Reason:
setFillAfter(true);
is set, I don’t know the specific reason.Solution:
Reference: http://blog.csdn.net/nijiayy/article/details/40683639
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
Is the moving position wrong?
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.