美文网首页
tableview中自定义自定义左滑显示编辑按钮

tableview中自定义自定义左滑显示编辑按钮

作者: H_A_N | 来源:发表于2017-09-23 14:14 被阅读0次
// 自定义左滑显示编辑按钮

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

{

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

    UITableViewRowAction *rowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault

                                                                         title:@"跟进" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {

                                                                             NSLog(@"跟进");

                                                                             

                                                                         }];

    

    UITableViewRowAction *rowActionSec = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault

                                                                            title:@"快速备忘"    handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {

                                                                                NSLog(@"快速备忘");

                                                                                

                                                                            }];

    rowActionSec.backgroundColor = [UIColor colorWithHexString:@"f38202"];

    rowAction.backgroundColor = [UIColor colorWithHexString:@"d9d9d9"];

    

    NSArray *arr = @[rowAction,rowActionSec];

    return arr;

}

相关文章

网友评论

      本文标题:tableview中自定义自定义左滑显示编辑按钮

      本文链接:https://www.haomeiwen.com/subject/lwscextx.html