hy如果移动,UIImageView将缩放而不是旋转,iOS
我想制作一个小动画。如果图像是静态的,旋转工作正常。 但当我移动我的图像视图时,它会拉伸图像。如果图像没有旋转,则可以将图像移动至 。
-(void)play
{
CGRect ship=image.frame;
ship.origin.x=ship.origin.x+move;
ship.origin.y=ship.origin.y+move2;
image.frame=ship;
}
-(void)rotate
{
int degre=180;
float radian=degre*(3.14/180);
image.transform =CGAffineTransformMakeRotation(radian);
}
这是您的实际代码? 'CGRect ship = image'看起来很可疑。 - 使用'M_PI'而不是'3.14'! –