旋转和移动UIImageView(CocoaTouch) [英] Rotating and Moving a UIImageView (CocoaTouch)
本文介绍了旋转和移动UIImageView(CocoaTouch)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此代码适用于旋转:
CGAffineTransform transform = CGAffineTransformMakeRotation(radians(lastAngle++));
anImage.transform = transform;
这个代码可以移动我的 UIImageView
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?
推荐答案
改变center属性。
Change the "center" property instead.
这篇关于旋转和移动UIImageView(CocoaTouch)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文