当前位置: 代码迷 >> Android >> Android动画片的fillAfter属性
  详细解决方案

Android动画片的fillAfter属性

热度:48   发布时间:2016-04-27 22:06:57.0
Android动画的fillAfter属性
转载请注明:[noyet12的博客](http://blog.csdn.net/u012975705)博客原址:http://blog.csdn.net/u012975705/article/details/49998813

想要Android中fillAfter属生效,有2种写法

直接在代码中设置:

animation.setFillAfter(true);

在xml中设置,注意了:必须在中设置,否则无效

<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android"    android:fillAfter="true">    <scale        android:duration="2000"        android:fromXScale="1.0"        android:fromYScale="1.0"        android:pivotX="50%"        android:pivotY="50%"        android:toXScale="0.0"        android:interpolator="@android:anim/accelerate_decelerate_interpolator"        android:toYScale="0.0"/>    <rotate        android:duration="2000"        android:fromDegrees="+360"        android:interpolator="@android:anim/accelerate_decelerate_interpolator"        android:pivotX="50%"        android:pivotY="50%"        android:toDegrees="0"/></set>
  相关解决方案