UIImageView响应点击事件
NSString *URL =@"http://xxx.jpg";
NSData *imageData = [[NSDataalloc]initWithContentsOfURL:[NSURLURLWithString:URL]];
UIImage *image=[[UIImagealloc] initWithData:imageData];
[imgADBanner setImage:image];
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@selector(handleSingleTap:)];
[imgADBanneraddGestureRecognizer:singleTap];
[singleTap release];
[imageData release];
- (void)handleSingleTap:(UIGestureRecognizer *)gestureRecognizer {
//do something....
}
摘自 sql_help的专栏
补充:移动开发 , IOS ,