2011-09-22 2 views
1

하위 뷰가 있는데 여기에는 UIButton도 있습니다. 자, 일단 touchesEnded를 입력하면 주 하위 뷰를 터치 한 경우에만 (UIButton이 아닌) 몇 가지 지침을 실행하려고합니다.subview (버튼이 아닌) 안의 anytouch 감지 touchesEnded

이 방법이 있습니까 ??

미리 감사드립니다. ezbz

답변

0

좌표를 적절하게 비교하여 이러한 이벤트를 사용하여 논리를 작성하십시오.

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 

    } 
    -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ 
     UITouch *aTouch = [touches anyObject]; 
     CGPoint point = [aTouch locationInView:self.view]; 
     NSLog(@"X%f",point.x); 
    } 

    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ 

    } 
관련 문제