首页 > 其他 > 详细

transform

时间:2014-05-28 13:34:41      阅读:340      评论:0      收藏:0      [点我收藏+]

- (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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!