有没有办法在XCode中使用Pinch Gesture工具播放一系列图像?如果是这样,怎么样?
任何帮助将不胜感激! :)
戴夫。
答案 0 :(得分:0)
这是常见的解决方案,通过在每个imageView中添加pinchGesture,并在调用手势事件时调用回调委托。
for (int i = 0;i<=8;i++){
UIImageView *imageView = [[UIImageView alloc] init]
imageView.userInteractionEnabled = YES;
UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc]
initWithTarget:self action:@selector(handlePinch:)];
pinch.delegate = self;
pinch.tag = self;
[imageView addGestureRecognizer:pinch];
}
- (void)handlePinch:(UIPinchGestureRecognizer *)pinchGestureRecognizer
{
//handle pinch...
}