我有一个UIImageView对象,我与框架属性和CFAffineTransformMakeRotate旋转,然后我想ot移动它的框架的移动原点,但我的图像移动和strangly重塑。Draggable UIImgeView Rotation
@implementation TimberView
(void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { // Retrieve the touch point CGPoint pt = [[touches anyObject] locationInView:self]; startLocation = pt; [[self superview] bringSubviewToFront:self]; }
(void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { // Move relative to the original touch point CGPoint pt = [[touches anyObject] locationInView:self]; CGRect frame = [self frame];
frame.origin.x += pt.x - startLocation.x; frame.origin.y += pt.y - startLocation.y; [self setFrame:frame]; }
的TimberView类是的UIImageView
的一个子类
你可以将代码发布到移动视图的位置吗? – Vladimir 2010-08-12 09:38:03
我已经发布了它。 – vahid 2010-08-14 08:18:39