The Cgaffinetransform class in the Coregraphics framework can be used to set the transform properties of the UIView, control the zoom, rotate, and pan operations of the view:
Also known as the radiation transformation matrix, can refer to linear algebra matrix implementation mode 0.0
The Cgaffinetransform official documentation is attached here:
Https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGAffineTransform/index.html
Transform is a state, and there is only one state
(1) Cgaffinetransformmaketranslation (< #CGFloat Tx#>, < #CGFloat ty#>): Can only be changed once, because changes in this way are always changed with the most primitive state values, So it only changes once.
For example:
UIButton *head = (UIButton *) [Self.view viewwithtag:10]; Head.transform = Cgaffinetransformmaketranslation (0,-10);
(2) Cgaffinetransformtranslate (Cgaffinetransform T, < #CGFloat Tx#>, < #CGFloat ty#>): Able to change many times, Each change is a change in the state of the above (Cgaffinetransform T), so multiple changes can be made
0,-ten);
(3) Cgaffinetransformidentity: Clears all settings of the transform (general and animated with use, can only be used for transfofrm settings of the screen)
UIButton *head = (UIButton *) [Self.view Viewwithtag:ten]; = Cgaffinetransformidentity;
(4) Cgaffinetransformmakescale (cgfloat sx, cgfloat sy)(zoom: Set scale) The effect of the view rushing and indenting the frequency screen is achieved only by setting the zoom scale.
UIButton *head = [Self.view viewwithtag:ten]; = Cgaffinetransformscale (head.transform,1.5,1.5);
(5)cgaffinetransformmakerotation (cgfloat angle)(rotation: Set rotation angle)
UIButton *head = [Self.view viewwithtag:ten]; = Cgaffinetransformmakerotation (m_pi_2);
UIButton *head = (UIButton *) [Self.view Viewwithtag:ten]; = Cgaffinetransformrotate (Head.transform,-m_pi_4);
Simple use of iOS basic Cgaffinetransform