动画系列 03:属性动画详解(fillAfter,fillBefore)

Published: 30 Nov 2017 Category: 动画

##fillAfter

  1. 默认设置为false,动画结束后,View回到动画初始时位置;
  2. 设置为true,动画执行完毕后,View停留在动画结束时位置;但是View实际点击事件等触发却在View初始化位置(需注意)

##fillBefore

  1. 动画开始前,会将View置于动画初始位置,默认设置为true
  2. 如果设置为false,动画播放前,如果动画初始位置与View可见展示位置不一样,则会跳动到动画初始位置,然后开始执行动画

##总结 使用Animation、AnimationSet框架实现的动画效果,必须先将View放置到最终的目标位置, 然后倒过来,播放从原始位置到目标位置的动画

参考链接

  1. http://blog.csdn.net/fengkuanghun/article/details/7878862
  2. https://www.jianshu.com/p/ee0c1dda0275
  3. https://www.cnblogs.com/dasusu/p/8595422.html
  4. https://www.jianshu.com/p/48317612c164