TablView长按手势执行两次的问题
来源:互联网 发布:算法的发展成果 编辑:程序博客网 时间:2024/06/07 07:23
直接上代码:
NSString *firstCellID =@"firstCellID";
MyAlbumFirstCell *firstCell = [tableViewdequeueReusableCellWithIdentifier:firstCellID];
if (firstCell ==nil)
{
firstCell = [[MyAlbumFirstCellalloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:firstCellID];
}
UILongPressGestureRecognizer *longPressGesture = [[UILongPressGestureRecognizeralloc]
initWithTarget:selfaction:@selector(cellLongPress:)];
[firstCell addGestureRecognizer:longPressGesture];
return firstCell;
#pragma mark - cell长按手势触发的方法
- (void)cellLongPress:(UILongPressGestureRecognizer *)cellLongPress
{
if (cellLongPress.state ==UIGestureRecognizerStateBegan)
{
CGPoint point = [cellLongPresslocationInView:_tableView];
NSIndexPath *indexPath = [_tableViewindexPathForRowAtPoint:point];
if (indexPath !=nil)
{
NSLog(@"%ld", indexPath.row);
}
}
}
- TablView长按手势执行两次的问题
- UIButton文字对齐与手势长按执行两次的问题
- iOS 长按手势执行两次解决办法
- iOS 长按手势执行两次解决办法
- 解决长按手势两次触发事件的问题
- iOS开发-进阶:长按手势执行两次解决办法
- iOS 长按手势响应执行两次解决办法
- IOS给tableview的cell添加长按手势执行两次(UILongPressGestureRecognizer)
- UILongPressGestureRecognizer 执行两次的问题
- AOP 执行两次的问题
- 长按手势响应弹出UIActionSheet碰到的问题
- 在按钮上添加长按手势的一些问题
- iphone响应地图长按事件 解决长按响应两次的问题
- 定义响应的手势类:长按手势,缩放手势
- UITableViewCell添加长按手势问题
- struts2 中action执行两次的问题
- SQL语句的两次执行问题
- mybatis执行两次相同的查询问题
- gradle生成aar文件及使用本地aar文件
- 【插件】自适应布局JQuery插件,rem布局——和派孔明
- Linux学习笔记(1) --- 使用VMWare WorkStation安装Linux Mint
- 第13周 数据结构(上海交大) 5-3 前m与后n个元素整体互换
- JavaScript正则表达式上之基本语法
- TablView长按手势执行两次的问题
- 求取一个字符串的最大回文子串
- MVC控制器流程
- spring注解
- 【WebService框架-CXF】——CXF+Spring+Struts+自定义拦截器构建WebService客户端
- Java标准输入输出串流
- Win32游戏制作之---SwordsMan
- byte[ ]数组承接内容时候分配空间
- [Docker]Docker简介