-(ibaction) Hidebut: (ID) Sender {if(SELF.FLG) {[UIView animatewithduration:0.3animations:^{self.meunBaseLayer.transform= Cgaffinetransformrotate (Self.meunBaseLayer.transform,3.14); //scaling is scaled proportionallySelf.meunBaseLayer.transform = Cgaffinetransformscale (Self.meunBaseLayer.transform,0.5,0.5); }]; SELF.FLG=NO; }Else{[UIView animatewithduration:0.3animations:^{self.meunBaseLayer.transform= Cgaffinetransformrotate (Self.meunBaseLayer.transform,-3.14); Self.meunBaseLayer.transform= Cgaffinetransformscale (Self.meunBaseLayer.transform,2,2); }]; SELF.FLG=YES; } }
1. Declare a FLG flag globally to determine whether the button is enlarged or scaled.
2. Add an animation during the execution of the view.
3. Change the view's shape by the view's Transfrom property to rotate the angle.
Cgaffinetransformrotate: View rotation, determines the angle of rotation based on the positive and negative values of the π value.
Cgaffinetransformscale: View zoom, which is the action based on the scale of the current view .
iOS view rotation zooms in to zoom out