当你自定义一个cell的时候,在vc中想要对cell点击,进行编辑的时候,需要获得当前cell的行数时候。
可以在自定义cell中盖上一层view
UIView *view = [[UIView alloc] initWithFrame:self.frame];
view.alpha = 0;
view.backgroundColor = [UIColor clearColor];
[self addSubview:view];
- (void)addDelete:(id)sender
{
NewsViewTableViewCell *cell = (NewsViewTableViewCell *)[[[sender superview] superview] superview];
NSIndexPath *indexPath = [_tableView indexPathForCell:cell];
NSLog(@"indexPath");
}
本文详细介绍了如何在自定义cell中实现点击事件,并获取当前cell对应的行数,涉及iOS开发中的UITableView与Cell交互机制。
427

被折叠的 条评论
为什么被折叠?



