Rotating and Moving a UIImageView (CocoaTouch)
Posted
by yar
on Stack Overflow
See other posts from Stack Overflow
or by yar
Published on 2010-06-10T21:31:45Z
Indexed on
2010/06/10
21:53 UTC
Read the original article
Hit count: 266
iphone
|cocoa-touch
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?
© Stack Overflow or respective owner