zoukankan      html  css  js  c++  java
  • Animation.setFillAfter and Animation.setFillBefore的作用

    转:http://blog.csdn.net/yangweigbh/article/details/9788531

    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, 就会在移动动画结束的位置淡出

  • 相关阅读:
    对象结构型
    对象结构型
    对象行为型模式
    定时任务(二)
    定时任务(一)
    kill端口-更新sql-添加字段
    获取ip和端口号
    List集合中的末位元素置首位
    首页报表数据展示(一)
    具体的类中包括枚举类写法
  • 原文地址:https://www.cnblogs.com/liulipeng/p/3962101.html
Copyright © 2011-2022 走看看