2010-03-27 3 views
0

UIImageView에서 손가락을 움직일 때 어떻게 감지합니까? 예를 들어 손가락을 슬라이드하면 색상이나 다른 것이 바뀝니다. 여러 UIImageViews를 가로 질러 미끄러지면서 무언가가 일어나길 원합니다 ...손가락 슬라이딩 UIImageView

답변

0

UIScrollView 안에 UIImageView을보십시오!

UIImageView에서 터치를 감지하려면 UIImageView을 고쳐야하고 UserInteractionEnabledYES으로 설정해야합니다. 그런 다음 touchesBegantouchesEnded과 같은 이벤트를 처리 할 수 ​​있습니다.

UIImageWithTouchControl.h

@interface UIImageWithTouchControl : UIImageView 

UIImageWithTouchControl.m

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

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