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:  }
  • 相关阅读:
    Android性能调优实例
    Android移动端网络优化
    性能优化之Java(Android)代码优化
    Android性能优化之布局优化
    Android性能优化之数据库优化
    Android性能优化系列总篇
    ViewGroup的事件分发机制
    Apk大瘦身
    不安装APK直接启动应用
    Intent详解
  • 原文地址:https://www.cnblogs.com/zeyang/p/4457956.html
Copyright © 2011-2022 走看看