简体   繁体   English

UIImageView上的重叠手势识别器

[英]overlapping gesture recognizer on UIImageView

I have multiple UIImageView added into the main view, each UiImageView is displayed in its own parent UIView for cropping purpose and each UIImageView is also attached to a PanGestureRecognizer. 我在主视图中添加了多个UIImageView,每个UiImageView都显示在其自己的父UIView中以进行裁剪,每个UIImageView也都附加到PanGestureRecognizer。 I am curious on how to implement both pan gesturerecgonizer and also allow image swap by dragging one image (A) to hover over the other image (B) and hold, then the image A and B will be swapped (so A is now displayed in old B's UIView).. this is something like the iphoto app just implemented. 我很好奇如何既实现平移手势矩形器又如何通过拖动一个图像(A)将鼠标悬停在另一图像(B)上并按住来允许图像交换,然后图像A和B将被交换(因此A现在显示在老B的UIView)..这类似于刚刚实现的iphoto应用。

my thought would be somehow create a custom gesture recognizer at the superview layer, but I don't want to lose the pangesturerecognizer applied to each image, how can this be done? 我的想法是以某种方式在超级视图层创建一个自定义手势识别器,但是我不想丢失应用于每个图像的pangesturerecognizer,这怎么办?

为什么不通过两个手指来启用平移手势,而通过touches方法来实现拖动功能呢?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM