zoukankan      html  css  js  c++  java
  • 自定义cell侧滑删除

    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 

        return YES;

    }

    // 自定义左滑显示编辑按钮
    -(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;
    }

  • 相关阅读:
    关联规则挖掘算法综述
    Python中*args 和**kwargs的用法
    VIM python 自动补全插件:pydiction
    Java设计模式--工厂模式
    Java设计模式--单列设计模式
    Java设计模式--UML类图类的关系(依赖,泛化, 实现,关联,聚合,组合)
    Java设计模式--设计模式七大原则
    SpringBoot 整合篇 笔记--Spring Boot与监管/热部署
    SpringBoot 整合篇 笔记--Spring Boot与分布式
    SpringBoot 整合篇 笔记--Spring Boot与任务/安全
  • 原文地址:https://www.cnblogs.com/lyz0925/p/6097619.html
Copyright © 2011-2022 走看看