iOS点击手势(tap)
来源:互联网 发布:minitool数据恢复软件 编辑:程序博客网 时间:2024/04/30 16:01
UIImageView *imgView = [[UIImageViewalloc] initWithFrame:CGRectMake(60,100, 100, 100)];
UIImage *image = [UIImageimageNamed:@"1.png"];
imgView.image = image;
imgView.userInteractionEnabled =YES;
//第二步 添加手势
//抽象类特点 不能创建对象
UITapGestureRecognizer *tap = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@selector(imageViewTap:)];
tap.delegate =self;
//设置属性点击此次 1单击 2双击
tap.numberOfTapsRequired =1;
//设置属性单击触控 还是多点触控
tap.numberOfTouchesRequired =1;
[imgView addGestureRecognizer:tap];
#pragma mark - 点击手势触发事件
-(void)imageViewTap:(UITapGestureRecognizer *)tap
{
NSLog(@"识别到了点击手势");
self.view.backgroundColor = [UIColorgreenColor];
}
0 0
- iOS点击手势(tap)
- IOS tap 手势
- 【学习笔记】uiview点击(手势点击tap)
- 轻击(tap)手势
- 【iOS开发笔记】Tap手势
- 解决Tap手势和UITableView点击冲突
- iOS 手势识别——敲击 Tap
- iOS button和tap手势冲突 解决方案
- Tap手势
- 给tableView添加tap手势,与点击cell冲突
- Tap手势与UITableView点击事件冲突解决办法
- IOS UIImageView 点击手势
- iOS开发Tap点击的区域问题。
- iOS开发之:手势(tap、pinch、rotation、swipe、pan、longpress)
- iOS中给webView添加tap手势无效果
- ios点击手势学习笔记
- iOS手势(拖动,缩放,旋转,点击,手势依赖,自定义手势)
- IOS开发(68)之捕获点击划屏手势
- linux学习考试复习笔记
- linux恢复误删除文件-ext3grep
- Jqgrid入门-显示基本的表格
- 福利 | 据说,每一个 iOSer 都想要一张 Swift 大会门票
- Activity launchMode详解
- iOS点击手势(tap)
- VS2015安装
- python AES-16位加密解密功能实现
- php 7.0的时代到来
- 钟
- 关于 "java中常量定义在interface中好还是定义在class中好" 的一些思考
- android中通过HTML设置文字颜色和字号
- 各种消息下wParam及lParam值的含义
- 清除无效的隧道适配器