IOS TableView 根据子view 来获取当前Cell 方式

来源:互联网 发布:apt模型 知乎 编辑:程序博客网 时间:2024/06/02 16:11

1. 通过superView 来获取

// sender = UITableView 中的子View

UITableView *cell = (UITableViewCell *) [sender superview];

NSIndexPath *indexpath = [tableview indexPathForCell:cell];

 int row = indexpath,row ; // row 就是tableview cell 的下标了


0 0