UIView 的旋转和缩放

时间:2021-06-08 16:12:32

原文地址:http://www.cnblogs.com/gaoxiao228/archive/2012/05/04/2483577.html

label.transform = CGAffineTransformMakeRotation(90 *M_PI / 180.0);

//顺时针旋转 90度

label.transform = CGAffineTransformMakeRotation(180 *M_PI / 180.0);

//顺时针 旋转180度

label.transform = CGAffineTransformMakeRotation(270 *M_PI / 180.0);

//顺时针旋转270度

CGAffineTransform transform = label.transform;

transform = CGAffineTransformScale(transform, 2,0.5);//前面的2表示横向放大2倍,后边的0.5表示纵向缩小一半

label.transform = transform;

UIView 的旋转和缩放