One, animation type
The Android animation consists of four types: alpha, scale, translate, rotate
In an XML configuration file
Second, Android animation mode
There are two main animation modes of animation: tweened and Frame
One is tweened animation (gradient animation)
Definition of animation in XML file
① open Eclipse, new Android Project
② New Anim folder in res directory
③ a new myanim.xml in the Anim directory (note file name lowercase)
④ Animation code to add XML
<?xml
version= "1.0" encoding= "Utf-8"?> <set xmlns:android=
"http://schemas.android.com/apk/res/" Android >
<alpha/>
<scale/>
<translate/>
<rotate/>
</set>
Iv. Analysis of Android XML animation
1. Alpha
<?xml version= "1.0" encoding= "Utf-8"?> <set xmlns:android=
"http://schemas.android.com/apk/res/" Android ">
<alpha
android:fromalpha=" 0.1 "
android:toalpha=" 1.0 "
android:duration=" "3000"
/>
<!--transparency Control animation effect Alpha
floating-point value:
Fromalpha property is the transparency at the beginning of the animation
Toalpha property for the animation at the end of the opacity
description:
0.0 means full transparency
1.0 indicates total opacity
the numeric long value of the float data type between 0.0-1.0 and above value
:
duration property for animation duration
Description:
time in milliseconds
-->
</set>