Android实现TextView动画缩放

scalebig.xml:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

    <scale
        android:duration="1000"
        android:fromXScale="1.0"
        android:fromYScale="1.0"
        android:pivotX="0"
        android:pivotY="50%"
        android:toXScale="1.5"
        android:toYScale="1.5" >
    </scale>

</set>

scalesmall.xml:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

    <scale
        android:duration="1000"
        android:fromXScale="1.0"
        android:fromYScale="1.0"
        android:pivotX="0"
        android:pivotY="50%"
        android:toXScale="0.7"
        android:toYScale="0.7" >
    </scale>

</set>

调用方法:

Animation a = AnimationUtils.loadAnimation(context, R.anim.scalebig);
	    			a.setFillAfter(true);
	    			holder.content.startAnimation(a);

相关推荐