iOS Development UI Chapter-transframe properties (deform)

Source: Internet
Author: User

1. Transform Properties

In OC, you can modify the translation, scaling, and rotation angles of an object by using the Transform property

Common methods for creating transform structures are divided into two main categories

(1) Create a deformation based on the initial position of the control

Cgaffinetransformmaketranslation (PAN)

Cgaffinetransformmakescale (zoom)

Cgaffinetransformmakerotation (swivel)

(2) Create a "transform parameter-based" deformation

Cgaffinetransformtranslate

Cgaffinetransformscale

Cgaffinetransformrotate

Add:

In OC, all values associated with the angle are in radians, 180°= M_PI

Positive number indicates clockwise rotation

Negative number indicates counterclockwise rotation

Tip: Because the Transform property can be superimposed on the last state of the control, for example, rotate and pan again. Therefore, in the actual animation development, when it involves the position, the size deformation effect, mostly modifies the control's transform attribute, but is not frame, bounds, center.

2. Main code

Displacement (not cumulative) 234     //self.headimageview.transform=cgaffinetransformmaketranslation (n), 235     //Zoom 236     / /self.headimageview.transform=cgaffinetransformmakescale (1.2), 237     //Displacement on original basis (is cumulative) 238     // Self.headimageview.transform=cgaffinetransformtranslate (Self.headImageView.transform, 239);     Scaling on an original basis     //self.headimageview.transform=cgaffinetransformscale (Self.headImageView.transform, 1.5, 1.6) 241     242     //Rotate 243     if (rotate.tag) {244         //rotation angle 1/pi, counterclockwise 245         on original basis Self.headimageview.transform=cgaffinetransformrotate (Self.headImageView.transform,-M_1_PI); 246     }247     else248     {249         //Rotation angle is PI/2, clockwise by     Self.headimageview.transform=cgaffinetransformrotate ( Self.headImageView.transform, m_pi_2); 251     }

iOS Development UI Chapter-transframe properties (deform)

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.