2012-04-18 2 views

답변

0

당신은 코드 아래 touchesBegan에게 이벤트를 시도 할 수 있습니다 :

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 
    if([touch view] ==self.my_view)//Check click your uiview or not 
    { 
     CGRect frame = [your_image_view frame]; 
     CGPoint touchLocation = [touch locationInView:touch.view]; 
     frame.origin.x=touchLocation.x; 
     frame.origin.y=touchLocation.y; 
     [your_image_view setFrame:frame]; 
     [self.my_view addSubview:your_image_view]; 
    } 

} 

감사합니다 ..!

+0

감사합니다. – user49336

0

글쎄, 첫 번째 단계는 상위 수준의 API UIGestureRecognizer을 사용하고 UI보기에 추가하는 것이 좋습니다 UIView의 터치를 감지하는 것입니다. 그런 다음 콜백을 사용하여 원하는 모든 작업을 수행 할 수 있습니다. 그렇다면 애니메이션 블록을 사용하여 변경 사항을 애니메이션으로 만들 수 있습니다.

+0

조언 해 주셔서 감사합니다! – user49336

관련 문제