在app委托iOS中触摸事件

时间:2011-07-28 14:21:00

标签: iphone objective-c

如何在UIImageView中为appDelegate实现触控?

2 个答案:

答案 0 :(得分:4)

您可以使用:

UITapGestureRecognizer *tgr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(anyMethod)];  
[imageView addGestureRecognizer:tgr];  
[tgr release];  

在此之前,启用UIimageView的用户交互。

答案 1 :(得分:1)