UIImageView *image = [[UIImageView alloc]init];
image.frame = CGRectMake(50, 50, 200, 200);
image.image = [UIImage imageNamed:@"460.jpg"];
[self.view addSubview:image];
CGAffineTransform transform= CGAffineTransformMakeRotation(M_PI*0.38);
/*关于M_PI
#define M_PI 3.14159265358979323846264338327950288
其实它就是圆周率的值,在这里代表弧度,相当于角度制 0-360 度,M_PI=180度
旋转方向为:顺时针旋转
*/
image.transform = transform;//旋转
网友评论