Animation.setFillAfter and Animation.setFillBefore的作用
2014-09-09 09:45
453 查看
转:http://blog.csdn.net/yangweigbh/article/details/9788531
If fillAfter is true, the transformation that this animation performed will persist when it is finished.
但是,animation只是操作View 的位图表示(bitmap representation),而不是真正的改变View的位置
动画结束后,View回到了原来的位置,setFillAfter 和 setFillBefore 并不能解决这个问题,要使View保持动画结束时的状态,必须另外改变View的属性(动画并不会帮助你改变View的属性),setFillAfter 和 setFillBefore 只能改变动画的属性
为什么会有setFillAfter 和 setFillBefore这两个方法:
是因为有动画链的原因,假定你有一个移动的动画紧跟一个淡出的动画,如果你不把移动的动画的setFillAfter置为true,那么移动动画结束后,View会回到原来的位置淡出,如果setFillAfter置为true, 就会在移动动画结束的位置淡出
setFillAfter(boolean fillAfter)在Android developer上的文档:
If fillAfter is true, the transformation that this animation performed will persist when it is finished.
但是,animation只是操作View 的位图表示(bitmap representation),而不是真正的改变View的位置
动画结束后,View回到了原来的位置,setFillAfter 和 setFillBefore 并不能解决这个问题,要使View保持动画结束时的状态,必须另外改变View的属性(动画并不会帮助你改变View的属性),setFillAfter 和 setFillBefore 只能改变动画的属性
为什么会有setFillAfter 和 setFillBefore这两个方法:
是因为有动画链的原因,假定你有一个移动的动画紧跟一个淡出的动画,如果你不把移动的动画的setFillAfter置为true,那么移动动画结束后,View会回到原来的位置淡出,如果setFillAfter置为true, 就会在移动动画结束的位置淡出
相关文章推荐
- Animation.setFillAfter and Animation.setFillBefore的作用
- Animation.setFillAfter and Animation.setFillBefore的作用
- Animation.setFillAfter and Animation.setFillBefore的作用
- 关于Android Animation的setFillBefore、setFillAfter和setFillEnable
- Animation.setFillAfter的作用
- Animation.setFillAfter 是什么意思呢
- setFillAfter 和 setFillBefore只能改变动画的属性
- animation.setFillAfter(true)无效问题
- translateAnimation.setFillxxx()作用是什么?
- Animation 的setFillAfter
- animationSet.setFillAfter方法无效
- 解决安卓动画setFillAfter无效的问题
- CRT code before and after main
- WCF Before Call and After Call
- After Effects and Photoshop: Animation and Production Effects for DV and Film
- Oracle Trigger :Before,after,each row and table level triggers ORA-04082 ORA-04084
- 终于解决了一个动画的问题:setFillAfter(true)后不可以隐藏
- CSS伪元素 after AND before
- Insert Function before and after main function
- Working with BeforeProperties and AfterProperties on SPItemEventReceiver