tableView编辑模式下删除多个cell

来源:互联网 发布:如何在淘宝上卖货 编辑:程序博客网 时间:2024/06/05 20:09

在编辑模式下,tableView有自带的删除多个cell的方法。 这种效果自定义写也可以,但是我这里用的是系统的。

先上效果图。核心代码:

    _tableView.allowsMultipleSelectionDuringEditing =YES;

至于全选删除和选择一部分删除就不上具体代码了。



如果想要点击cell后的颜色,代码如下:

            //选中cell的背景色

           UIImageView *imageView = [[UIImageViewalloc]init];

            imageView.backgroundColor = [UIColorclearColor];

            cell.selectedBackgroundView = imageView;

           //对勾的背景色

            cell.tintColor =MyPinkColor;

效果:

0 0