2011-04-14 6 views
0

UIPanGestureRecognizerUIImageView에서 작동하지 않고 UIView에서 작동하지 않는 정확한 이유를 알려 주실 수 있습니까? 나는 어떤 블로그도 찾지 못했습니다. 아래는 내가 그 팬이 작동하지 않는 UIIMageView 개체로 endimage을 변경하고있는 경우 (현재 작업) 내 코드UIPanGestureRecognizer가 uiimageview 용으로 만 uiview 용으로 작업하고 있습니다.

UIView *endImage=[[UIView alloc]init]; 

    endImage.backgroundColor=[[UIColor yellowColor] colorWithAlphaComponent:0.3f]; 
    UIPanGestureRecognizer *panOnEndImage = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanOnLine:)]; 

    panOnEndImage.delegate=self; 
    [endImage addGestureRecognizer:panOnEndImage]; 
    [anotherUIView addSubview:endImage]; 
    [panOnEndImage release]; 

은 ... 감사합니다 사전에 귀하의 제안이 더 중요하다.

+1

이 줄을 추가하고 시도하십시오. [endImage setUserInteractionEnabled : YES]; – Ravin

+0

감사합니다. – ajay

답변

2

이 줄을 추가하고 시도하십시오. [endImage setUserInteractionEnabled:YES];이 답변입니다. (맞음;)!

관련 문제