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)