Following the Java implementation of the previous tween animation: http://www.cnblogs.com/fengtengfei/p/3957800.html,
Here I go on to introduce the XML implementation method of tween animation,
First we need in the Res folder in the establishment of the Anim folder, and then in the Anim folder to build the relevant animation XML, and set Zodiac can be.
We then load the XML file with the animationutils.loadanimationin the activity.
Animation Animation = Animationutils.loadanimation (this, r.anim.roatate);
Iv.startanimation (animation);
One of the things to note is:
1: For example, our translate.xml. If we need to move relative to the parent window, we need to add p after 20%, which is 20%p, which indicates the size of the parent window.
<?xml version= "1.0" encoding= "Utf-8"? ><translate xmlns:android= "http://schemas.android.com/apk/res/ Android " android:fromxdelta=" 20%p " android:toxdelta=" 50%p " android:fromydelta=" 0 " android: Toydelta= "50%p" android:duration= "></translate>"
2: We need to mix the definition of animation, we just want to define the animation type corresponding to the XML node, write to the inside of the set node.
Like Set.xml.
<?xml version= "1.0" encoding= "Utf-8"? ><set xmlns:android= "Http://schemas.android.com/apk/res/android" > <alpha............> </alpha>............</set>
The XML implementation of the Android learning note-tween Animation