原版这个网址:http://blog.youkuaiyun.com/linux_zkf
实现效果图如下两个图示所示
操作前 操作中
IOS UITableView 可删除行实现很简单主要注意两点即可
下面是关键代码
[self.tableView setEditing:YES animated:YES];
这行设置行为可编辑删除实现在一下代码中实现
- (void)tableView:(UITableView *)tableView
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
[self.list removeObjectAtIndex:row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationFade];
}
其它的和普通的实现一样,这里没有给出代码其中list为:
NSMutableArray *list;