Android Animations Animation using detailed

Source: Internet
Author: User
Tags time in milliseconds xmlns

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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.