• 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:  }
  • 相关阅读:
    Centos安装VMware
    centos7下javac:未找到命令的问题
    Runtime
    JVM构架、GC垃圾回收机制的理解
    onsubmit校验表单时利用ajax的return false无效解决方法
    request和response的中文乱码问题
    Ajax,Json数据格式
    Oracle数据库对象,同义词、序列、视图、索引
    动态页面技术JSP/EL/JSTL
    会话技术Cookie&Session
  • 原文地址:https://www.cnblogs.com/zeyang/p/4457956.html
Copyright © 2020-2023  润新知