zoukankan      html  css  js  c++  java
  • iOS开发——给ImageView添加点击事件

    给ImageView添加点击事件

       1:  cell.pictureView.userInteractionEnabled = YES;
       2:      UITapGestureRecognizer *gr = [[UITapGestureRecognizer alloc]initWithTarget:cell action:@selector(displayPicture:)];
       3:      gr.numberOfTapsRequired = 1;
       4:      gr.numberOfTouchesRequired = 1;
       5:   [cell.pictureView addGestureRecognizer:gr ];
       1:  -(void)displayPicture:(UITapGestureRecognizer*)gr{
       2:      NSLog(@"%s----%@",__func__,gr);
       3:      [self.delegate displayPic:self.pictureView.image];
       4:  }
  • 相关阅读:
    Git使用教程
    安卓Activity全屏显示以及不显示title
    Android自定义权限
    java基础类型数据与String类包装类之间的转换与理解
    sQL存储过程的优缺点
    安卓5.0新特性
    Android中图片压缩(质量压缩和尺寸压缩)
    java基本数据类型所占字节数
    Android性能优化之一:ViewStub
    安卓内存优化和视图优化
  • 原文地址:https://www.cnblogs.com/zeyang/p/4457956.html
Copyright © 2011-2022 走看看