UIScrollView.I에 대한 터치 이벤트를 얻는 방법 UIViewController가 있으며 viewViewroller에 scrollView를 배치했습니다. scrollView에 imageViews를 추가해야하고 특정 이미지를 클릭하면 해당 viewController로 리디렉션해야합니다. . UIViewController에 터치 이벤트를 추가하는 방법을 알고있었습니다. 그러나 scrollView에서는 작동하지 않습니다.UIScrollView에 대한 Touches 이벤트
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch= [touches anyObject];
if ([touch view] == img1)
{
ViewController2 *viewController2=[[ViewController2 alloc]initWithNibName:@"ViewController2" bundle:nil];
[self presentViewController: viewController2 animated:YES completion:nil];
}
}
어떻게하면 scrollView에 대한 이벤트가 발생합니까?
http://stackoverflow.com/questions/14785395/dismissing-the-keyboard-from-a-uitextfield-uitextview-as-a-subview-of :
는 탭 제스처 인식기 설정 -uiscrollvi/14788474 # 14788474 – Rajneesh071