码迷,mamicode.com
首页 > 移动开发 > 详细

iOS开发——给ImageView添加点击事件

时间:2015-04-26 18:11:10      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

 

 

 

给ImageView添加点击事件

 

   1:  cell.pictureView.userInteractionEnabled = YES;
   2:      UITapGestureRecognizer *gr = [[UITapGestureRecognizer alloc]initWithTarget:cell action:@selector(displayPicture:)];
   3:      gr.numberOfTapsRequired = 1;
   4:      gr.numberOfTouchesRequired = 1;

 

 

   1:  -(void)displayPicture:(UITapGestureRecognizer*)gr{
   2:      NSLog(@"%s----%@",__func__,gr);
   3:      [self.delegate displayPic:self.pictureView.image];
   4:  }

iOS开发——给ImageView添加点击事件

标签:

原文地址:http://www.cnblogs.com/zeyang/p/4457956.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!