0
UIImageView에서 손가락을 움직일 때 어떻게 감지합니까? 예를 들어 손가락을 슬라이드하면 색상이나 다른 것이 바뀝니다. 여러 UIImageViews를 가로 질러 미끄러지면서 무언가가 일어나길 원합니다 ...손가락 슬라이딩 UIImageView
UIImageView에서 손가락을 움직일 때 어떻게 감지합니까? 예를 들어 손가락을 슬라이드하면 색상이나 다른 것이 바뀝니다. 여러 UIImageViews를 가로 질러 미끄러지면서 무언가가 일어나길 원합니다 ...손가락 슬라이딩 UIImageView
UIScrollView
안에 UIImageView
을보십시오!
UIImageView
에서 터치를 감지하려면 UIImageView
을 고쳐야하고 UserInteractionEnabled
을 YES
으로 설정해야합니다. 그런 다음 touchesBegan
및 touchesEnded
과 같은 이벤트를 처리 할 수 있습니다.
UIImageWithTouchControl.h
@interface UIImageWithTouchControl : UIImageView
UIImageWithTouchControl.m
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
}