我有一个subview,它是UIImageView,我有一个superview - uiview。
我将子视图添加到superview中。一开始,我使用代码移动子视图:
float difx = [[touches anyObject] locationInView:subview].x - [[touches anyObject] previousLocationInView:subview].x;
float dify = [[touches anyObject] locationInView:subview].y - [[touches anyObject] previousLocationInView:subview].y;
subview.transform = CGAffineTransformTranslate(subview.transform, difx, dify);而且它移动得非常好!(它朝着手指光标移动)。
但是如果我旋转superview,使用代码:
superview.transform = CGAffineTransformMakeRotation(degreesToRadians(angle));
此时,子视图的移动不正确,不正确!(它不会朝向手指光标移动)?
发布于 2012-12-11 00:24:58
试试这个:
CGAffineTransformRotate(CGAffineTransform t, CGFloat angle)https://stackoverflow.com/questions/13803475
复制相似问题