"Android Reprint" Rotateanimation detailed

Source: Internet
Author: User

Other constructors can also refer to this diagram for rotation.

The rotateanimation rotation coordinate system is a coordinate system (0,0) point with the rotation point. The x-axis is 0 degrees and rotates clockwise to a certain angle.
1.RotateAnimation (Fromdegrees, todegrees) [by default, the top-left vertex of the view is the rotation point].
The x-axis rotates clockwise to the starting point of the fromdegrees,
The x-axis rotates clockwise to the starting point of the todegrees.
such as fromdegrees=0,todegrees=90; the top left corner vertex is the rotation point. 0 degrees is the starting point, and 90 degrees is the endpoint. Rotated, rotated 90 degrees.
such as fromdegrees=60,todegrees=90; the top left corner vertex is the rotation point. 60 degrees is the starting point, and 90 degrees is the endpoint. Rotate the 90-60=30 degrees.

2.RotateAnimation (float fromdegrees, float todegrees, float pivotx, float pivoty)
(Pivotx,pivoty) is the rotation point. The pivotx is the offset from the left, and the Pivoty is the offset from the top. is the coordinate point relative to the upper-left corner of the view (0,0).
such as View width=100px,height=100px
Rotateanimation (0,10,100,100); Rotate 10 degrees clockwise from the original position with the lower-right corner vertex as the rotation point
Rotateanimation (0,90,50,50); Rotates 90 degrees with the center point of the view as the rotation point

3.RotateAnimation (Fromdegrees, Todegrees, Pivotxtype, Pivotxvalue, Pivotytype, Pivotyvalue)
Pivotxtype, Pivotxvalue, Pivotytype, pivotyvalue rotation point type and its value.
Animation.absolute is the absolute value of the other as a percentage. This peaceful moving picture of the same, do not know can go there to see
such as Rotateanimation (0, Animation.relative_to_self, 0.5f, Animation.relative_to_self, 0.5f); Rotate 90 degrees by center point
Effect and Rotateanimation (0,90,50,50) in 2 cases, rotate 90 degrees with the center point of the view as the rotation point. Same effect

Original link: http://www.cnblogs.com/beenupper/archive/2012/07/13/2590423.html

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.