//
// ViewController.m
// 04-transform
//
// Created by yibooo on 16/1/15.
// Copyright © 2016年 yibooo. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
- (IBAction)up;
- (IBAction)leftRotate;
@end
@implementation ViewController
- (IBAction)up {
// 1.取得头像按钮
UIButton *head = (UIButton *)[self.view viewWithTag:10];
// 2.每次向上移动10距离
head.transform = CGAffineTransformTranslate(head.transform, 0, -10);
}
- (IBAction)leftRotate {
UIButton *head = (UIButton *)[self.view viewWithTag:10];
// 旋转
head.transform = CGAffineTransformRotate(head.transform, -M_PI_4);
}
@end
04-transform
最新推荐文章于 2022-03-21 09:25:08 发布