您的位置:首页 > 其它

View setAnimation之后再setVisibility不起作用

2015-01-20 21:18 316 查看
前提是你的Animation设置了这样一个属性:

final Animation animation;animation.setFillAfter(true);

原因:

All the animations (before android 3.0) are actually applied to a bitmap which is a snapshot of your view instead of on your
original view. When you are setting the fill after to true this actually means that the bitmap will continue to be displayed on the screen instead of your view. This is the reason why the visibility won't change upon using
setVisibility
and
also the reason why your view will not be receiving touch events in its new (rotated) bounds.

解决方案:

1、将setFillAfter设置为false,或者不设置(默认是false)

2、在你要做动画的View外部嵌套一个View
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: