1 //panning2-(Ibaction) Trasnlate: (ID) Sender {3 //One -time move 10 of the distance4 //_button.transform = cgaffinetransformmaketranslation (ten, 0);5 6 //If you want to keep moving, you need to get the transform of the current view7 //1. Get the Transform property of the current button8Cgaffinetransform transform =_button.transform;9 Ten //2. Modification on the basis of transform One_button.transform = Cgaffinetransformtranslate (transform,Ten,0); A } - - //Zoom the-(Ibaction) Scal: (ID) Sender { - //Performing scaling - //_button.transform = Cgaffinetransformmakescale (0.5, 0.5); - + //Continuous Scale Execution - //1. Get the transform of the current button +Cgaffinetransform transform =_button.transform; A at //2. Make changes in transform -_button.transform = Cgaffinetransformscale (transform,0.5,0.5); - } - - //Rotate --(ibaction) Rotate: (ID) Sender { in - //_button.transform = cgaffinetransformmakerotation (m_pi_4); to + - the[UIView animatewithduration:1animations:^{ * //1. Get the transform of the current button $Cgaffinetransform transform =Self.button.transform;Panax Notoginseng - //2. Make changes in transform theSelf.button.transform =cgaffinetransformrotate (transform, m_pi_4); + ASelf.button.transform = Cgaffinetransformtranslate (transform, -,0); the +Self.button.transform = Cgaffinetransformscale (transform,1.5,1.5); - }]; $ } $ --(ibaction) Reset: (ID) Sender { - //Restore Original State the_button.transform =cgaffinetransformidentity; -}View Code
iOS development UI Chapter----UI Basics Transform