Android Property Animation Animation

Source: Internet
Author: User
animating views

In view animation, the View app animation does not change the view's properties, so the active area is the area before the animation is applied, such as when you move a button, the Click button does not have any reaction, it must be to his initial position to click.

Once the button is moved to the 200 position, clicking on the button does not work, then clicking on the initial position, the button will appear, so the effect is very bad

To change this, add some parameters to the view in Android 3.0 and add the corresponding Getter/setter function to these parameters (Objectanimator to change these properties with these functions):

  • Translationx,translationy:view offset relative to the original position
  • Rotation,rotationx,rotationy: Swivel, rotation for 2D rotation angle, 3D for the latter two
  • Scalex,scaley: Zoom ratio
  • The final coordinate of the X,y:view is the left,top position of the view plus the Translationx,translationy
  • Alpha: Transparency

 

Objectanimator animation = objectanimator.offloat (Button, "Translationx", 0f, 200f);

oa.setduration (+);

Oa.start ();

Now you can add animations and modify properties in such a way

Android Property Animation Animation

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.