Reference Links:
http://blog.csdn.net/imdxt1986/article/details/6952943
Animate a control
1, can be set in the XML file;
2, can be set in Java code.
First, create a new slide_right.xml under the Res/anim folder, as follows:
<set xmlns:android= "http://schemas.android.com/apk/res/android" android:interpolator= "@android: anim/ Accelerate_decelerate_interpolator "> <translate android:fromxdelta=" -100%p "android:toxdelta=" 0 " Android:duration= "@android: Integer/config_shortanimtime"/> </set>
Then, create a new list_anim_layout.xml under the Res/anim folder, as follows:
<layoutanimation xmlns:android= "http://schemas.android.com/apk/res/android" android:delay= "30%" Android: animationorder= "Reverse" android:animation= "@anim/slide_right"/>
1, set the animation in the XML file;
Add the following configuration directly to the control:
<span style= "FONT-SIZE:18PX;" >android:layoutanimation= "@anim/list_anim_layout" </span>
For example:
<span style= "FONT-SIZE:18PX;" ><textviewandroid:id= "TextView1" android:text= "Mytextview" android:layoutanimation= "@anim/list_anim_layout "></TextView></span>
2. Set in Java code:
Animation anim = animationutils.loadanimation (Getbasecontext (), r.anim.slide_right); Layoutanimationcontroller lac = new Layoutanimationcontroller (anim); Lac.setorder (layoutanimationcontroller.order_random); Lac.setdelay (1); Control name. Setlayoutanimation (LAC)
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
android-layoutanimation animation Effects-Example