码迷,mamicode.com
首页 > 其他好文 > 详细

transform

时间:2014-05-28 13:36:43      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:c   a   cti   for   ui   view   

- (IBAction)leftRotate {

    // 1.取得头像按钮

    UIButton *head = (UIButton *)[self.view viewWithTag:10];

    

    // 2.向左旋转45°

    // 45  180

    // 角度是正数:顺时针, 角度是负数:逆时针

//    head.transform = CGAffineTransformMakeRotation(-M_PI_4);

    head.transform = CGAffineTransformRotate(head.transform, M_PI_4);

}

 

- (IBAction)up {

    // 1.取得头像按钮

    UIButton *head = (UIButton *)[self.view viewWithTag:10];

    

    // 2.每次向上移动100的距离

//    head.transform = CGAffineTransformMakeTranslation(0, -100);

    head.transform = CGAffineTransformTranslate(head.transform, 0, -100);

}

 

- (IBAction)big {

    // 1.取得头像按钮

    UIButton *head = (UIButton *)[self.view viewWithTag:10];

    

    // 2.增大

//    head.transform = CGAffineTransformMakeScale(1.5, 1.5);

    head.transform = CGAffineTransformScale(head.transform, 1.5, 1.5);

}

 

transform,布布扣,bubuko.com

transform

标签:c   a   cti   for   ui   view   

原文地址:http://www.cnblogs.com/ZippoatiOS/p/3754993.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!