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'! –