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
also the reason why your view will not be receiving touch events in its new (rotated) bounds.
解决方案:
1、将setFillAfter设置为false,或者不设置(默认是false)
2、在你要做动画的View外部嵌套一个View
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
setVisibilityand
also the reason why your view will not be receiving touch events in its new (rotated) bounds.
解决方案:
1、将setFillAfter设置为false,或者不设置(默认是false)
2、在你要做动画的View外部嵌套一个View
相关文章推荐
- Android的setVisibility(View.GONE)不起作用在使用Animation之后.
- ios8 UITableView设置 setSeparatorInset:UIEdgeInsetsZero不起作用的解决办法
- 从源码上分析ListView/GridView调用setEmptyView不起作用的原因及解决办法
- ios8 UITableView设置 setSeparatorInset:UIEdgeInsetsZero不起作用的解决办法
- setAnimationTransition:forView:cache: 运行动画时背景色问题
- ListView.setEmptyView不起作用
- UIImageView setAnimationImages
- 动态添加ImageView 设置setPadding不起作用问题
- uiview 的setAnimationTransition : forView 方法实现翻页效果
- 从源码分析Animation动画与setVisibility(View.GONE)之间的小坑
- ios8 UITableView设置 setSeparatorInset:UIEdgeInsetsZero不起作用的解决办法
- Android TextView Button setPadding不起作用
- viewpager动态更新数据重新setAdapter(FragmentPagerAdapter)不起作用
- 动态增加view 的动画 AnimationSet.addAnimation
- 【android】从源码上分析ListView/GridView调用setEmptyView不起作用的原因及解决办法
- Android TextView setGravity不起作用
- 动态添加ImageView 设置setPadding不起作用问题
- 有没有人遇见过setVisibility(View.GONE) 不起作用?
- Android 给Animation设置setRepeatMode不起作用
- android 动画animation setRepeatCount不起作用