iOS tableView自定义删除按钮

// 自定义左滑显示编辑按钮

- (NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {

    UITableViewRowAction *rowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"  删除  " handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {

        NSLog(@"删除");

    }];

    rowAction.backgroundColor = [UIColor yellowColor];

    NSArray *arr = @[rowAction];

    return arr;

}

 

posted @ 2017-02-14 14:52  TigerCui  阅读(2226)  评论(0)    收藏  举报