나는 임의의 위치를 클릭하고 그 이미지를 이동하면서 동일한 이미지를 반복하여 추가하는 어플리케이션에서 작업하고 있습니다.특정 부분에서 움직이는 uiimagegview를 바인딩하는 방법
그러나 그 이미지를 움직이면 이미지는 전체보기에서 움직일 수 있습니다. UIView에서 움직이는 것에 영감을 얻습니다. 이미지를 추가하려는 하위 뷰 (UIImage 뷰)에서만 움직이기를 원합니다.
CGPoint touchLocation = [touch locationInView:[imgPimple superview]];
내가 생각 :
여기 당신이 일을해야하는 것은있는 touchesMoved
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
UIImageView *imgPimple;// = [[UIImageView alloc]init];
imgPimple = (UIImageView*)[touch view];
CGPoint touchLocation = [touch locationInView:imgPimple superview];
if ([touch.view isKindOfClass:[UIImageView class]])
{
imgPimple.center = touchLocation;
}
}
지금까지 해보신 것은 무엇입니까? 특히 무언가에 문제가 있습니까? – jtbandes