您的位置:首页 > 移动开发 > IOS开发

在点击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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息