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;
    }

  • 相关阅读:
    接着上回,导包正确之后,出现javabean.Friend cannot be cast to java.util.List,的错误。找了很久。以为是User user0作为参数,改成了String username还是错误,看了看listFriend.jsp没有错误,我想会不会是包多了,导致类型复杂。最后发现包少了一个:
    c语言
    软链接和硬链接的联系和区别
    centos7怎么永久修改hosname
    虚拟机静态ip设置
    Centos、Ubuntu开启命令模式
    Kubernetes重要概念理解
    人生道路上,永远没有“容易”二字
    知识【英文】
    模板【kruskal重构树】
  • 原文地址:https://www.cnblogs.com/lyz0925/p/6097619.html
Copyright © 2011-2022 走看看