Summary of the recent use of animations based on online materials and your own understanding
There are four types of animations in Android: gradient transparency Animation effect, gradient scaling Animation effect, screen conversion position movement Animation effect, and screen transfer rotation Animation effect.
How to define an animation in an XML file
① Open Eclipse and create an Android Project
② Create an anim folder in the res directory
③ Create a new myanim. xml file in the anim directory (note that the file name is in lower case)
④ Add XML animation code
<? Xml version = "1.0" encoding = "UTF-8"?>
<Set xmlns: android = "http://schemas.android.com/apk/res/android">
<Alpha/> <! -- Gradient transparency animation effect -->
<Scale/> <! -- Gradient scaling animation effect -->
<Translate/> <! -- Animation effect for moving the image conversion position -->
<Rotate/> <! -- Animation effects of screen transfer and rotation -->
</Set>
In Java code
AlphaAnimation gradient transparency animation effect
ScaleAnimation gradient scaling animation effect
TranslateAnimation
RotateAnimation image transfer rotation animation effect
The two most common methods are as follows:
Tween Animation (gradient Animation): animated effects are generated by constantly performing image transformations (translation, scaling, and rotation) on objects in the scenario.
Frame Animation (Frame Animation): Play the prepared images in sequence, similar to playing a movie.
Going on ......
Reference: http://liaobingyun.blog.163.com/blog/static/12981211120099975217653? Fromdm & fromSearch & isFromSearchEngine = yes
Http://ybxu-123.blog.163.com/blog/static/5947377020106632910792/