在点击tableviewcell之上的东西时获取当前点击的cell的section和row(通过当前点击的坐标点获取)
2016-11-20 10:50
573 查看
//两句话是保存触摸起点位置
UITouch *touch=[touches anyObject];
CGPoint cureentTouchPosition=[touch locationInView:self.TableView];
//得到cell中的IndexPath
NSIndexPath *indexPath=[self.TableView indexPathForRowAtPoint:cureentTouchPosition];
NSLog(@"section----%li,----row---%li",(long)indexPath.section,(long)indexPath.row);
UITouch *touch=[touches anyObject];
CGPoint cureentTouchPosition=[touch locationInView:self.TableView];
//得到cell中的IndexPath
NSIndexPath *indexPath=[self.TableView indexPathForRowAtPoint:cureentTouchPosition];
NSLog(@"section----%li,----row---%li",(long)indexPath.section,(long)indexPath.row);
相关文章推荐
- 通过添加点击手势获取当前坐标
- TableView 或者collectionView 获取点击的cell 和当前行数的方法
- UITableView获取cell的row值(解决自定义cell里的button通过点击无法获得cell的indexpath的问题)
- iOS中获取用户所点击的位置信息,并通过这个位置信息得到tableView的中的cell的indexPath.section
- UITableView获取cell的row值(解决自定义cell里的button通过点击无法获得cell的indexpath的问题)
- UITableView获取cell的row值(解决自定义cell里的button通过点击无法获得cell的indexpath的问题
- tableViewcell button点击 获取cell的indexpath 并刷新当前cell
- iOS中如何通过点击UITableViewCell中的Button来获取当前Cell的indexPath
- 点击UICollectionViewCell上的UIButton如何获取当前的UICollectionViewCell?
- 工具——通过鼠标点击获取图像坐标
- iOS 获取当前点击的cell相对于self.view的位置
- Google Map 2.0 获取当前倍率和当前点击所在地理坐标
- 获取cell/section相对于tableView 的坐标
- jQuery获取当前鼠标相对位置坐标和点击图片跳转上一张或下一张功能
- 点击屏幕获取对应tableviewcell
- Unity3d通过射线来实现点击地面,获取点击坐标
- iOS 获取当前点击的cell
- iOS开发- 根据表格点击tableviewCell获取在当前屏幕中的坐标值
- javascript获取当前点击事件的ID属性值,IE已验证通过
- qt通过点击按钮跳转当前图片坐标实现图片移动