Android Animation中fillAfter和fillBefore的使用

有的时候,在xml文件中使用动画的fillAfterfillBefore属性,会没有任何效果。后来在stackoverflow上发现了相关解答。

对于fillAfterfillBefore属性的使用,只有以下两种方式有效果:

  • 在代码中使用

animation.setFillEnabled(true);
animation.setFillAfter(true);

- **在xml文件的根标签中使用**
    + 单个动画是根标签
    
            
            
  
    + 动画集是根标签
        
            
            
                
            

你可能感兴趣的:(Android Animation中fillAfter和fillBefore的使用)