//实现删除cell的代理方法
-(NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath
*)indexPath
{
//设置删除按钮的文案 (1)
UITableViewRowAction *rowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"跟进" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull
indexPath) {
NSLog(@"跟进");
}];
//设置删除按钮的文案 (2)
UITableViewRowAction *rowActionSec = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"快速备忘" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull
indexPath) {
NSLog(@"快速备忘");
}];
rowActionSec.
backgroundColor = [PublicClass colorFromHexRGB:@"f38202"
];
rowAction.
backgroundColor = [PublicClass colorFromHexRGB:@"d9d9d9"
];
NSArray *arr = @[rowAction,rowActionSec]
;
return arr;
}
IOS TableView 左滑动删除Cell方法
最新推荐文章于 2023-09-01 11:22:00 发布