在编辑模式下,tableView有自带的删除多个cell的方法。 这种效果自定义写也可以,但是我这里用的是系统的。
先上效果图。核心代码:
_tableView.allowsMultipleSelectionDuringEditing =YES;
至于全选删除和选择一部分删除就不上具体代码了。
如果想要点击cell后的颜色,代码如下:
//选中cell的背景色
UIImageView *imageView = [[UIImageViewalloc]init];
imageView.backgroundColor = [UIColorclearColor];
cell.selectedBackgroundView = imageView;
//对勾的背景色
cell.tintColor =MyPinkColor;
效果: