This code works to rotate:
CGAffineTransform transform = CGAffineTransformMakeRotation(radians(lastAngle++));
anImage.transform = transform;
and this code works to move my UIImageView
CGRect frame = [anImage frame];
frame.origin.x+=1;
frame.origin.y+=1;
[anImage setFrame:frame];
but when I combine them, the image stretches out increasingly on each run through. Perhaps the frame should not be modified like this?
From the doc of .frame
:
http://developer.apple.com/iphone/library/Resources/439/Images/icon_warning.gif Warning: If the
transform
property is not the identity transform, the value of this property is undefined and therefore should be ignored.
The .transform
property can be used for translation too, see CGAffineTransformMakeTranslation or CGAffineTransformTranslate.
改为更改“中心”属性。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.