When you practice scaling the UIButton control, the click Control X, Y, or both increases or minus a certain number of pixels, after the search is XCODE5 turned on auto Layout.
Zoomed-out Code
-(Ibaction) Btnscale: (UIButton *) Sender { //animation start, set execution time [UIView beginanimations:nil context:nil]; [UIView Setanimationduration:1]; int tag = [sender tag]; float Scale = Tag = = 8? 1.2:0.8; Cgaffinetransform _transform = _btn.transform; _btn.transform = Cgaffinetransformscale (_btn.transform, scale, scale); _transform = _btn.transform; Commit animation [UIView commitanimations];}
Left and right rotation code
-(Ibaction) Btnrotate: (UIButton *) sender { [UIView beginanimations:nil context:nil]; [UIView Setanimationduration:1]; int tag = [sender tag]; int rotate = Tag = = 7? 1:-1; _btn.transform = Cgaffinetransformrotate (_btn.transform, m_pi_4*rotate); int rotate = tag==7? 1:-1; _btn.transform = Cgaffinetransformrotate (_btn.transform, m_pi_4*rotate); [UIView commitanimations];}
Actions to restore controls
-(Ibaction) Btnreset: (UIButton *) sender { [UIView beginanimations:nil context:nil]; [UIView Setanimationduration:1]; Sender.transform = cgaffinetransformidentity; [UIView commitanimations];}