2011-03-05 61 views

回答

2

UIImageView是UIView的子类。您可以使用addGestureRecognizer:将手势识别器添加到任何视图。

+0

注意这是标记[iphone-sdk-3.0],手势识别器直到3.2才加入。 – Anomie 2011-03-05 20:41:54

+0

好抓@Anomie - 我应该仔细阅读标签:) – Anurag 2011-03-05 20:42:44

2

我看到你标记了这个[iphone-sdk-3.0]。如果您可以使用SDK 3.2或更高版本,则可以使用UISwipeGestureRecognizer轻松完成。如果您必须坚持3.0,则必须继承UIImageView并处理touchesBegan:withEvent:,touchesMoved:withEvent:,touchesEnded:withEvent:和/或touchesCancelled:withEvent: