2012-05-21 2 views
1

내가 imageView- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 터치 방식을 사용하고 있지만 내가 직접scrollview에서 imageView 터치 이벤트를 수행하는 방법은 무엇입니까?

을있는 ScrollView 걸릴 때문에 터치 이벤트가 수행하지 왜 scrollview 그게 아래 imageView을 촬영 한

내 코드

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    // get touch event 
    UITouch *touch = [[event allTouches] anyObject]; 
    CGPoint touchLocation = [touch locationInView:self.view]; 

    if ([touch view] == imagedisplay) { 
     // move the image view 
     imagedisplay.center = touchLocation; 
    } 


} 

imagedisplay 내 이미지 뷰 객체 만에 작동하지 터치 이벤트 그 촬영 된 scrollview에서 일하고있어 imageView 그래서 scrollview 및 imageView 모두 적용되는 모든 솔루션과 소스 코드 관련 터치를 제공

답변

0

아래 코드를 사용하여, 당신이 만들고있는 imageView-

imageView.userInteractionEnabled = YES; 

기본값으로 NO입니다.

관련 문제