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

  • 相关阅读:
    逆变和协变
    委托的泛型版本
    委托的协变和逆变
    IIS8应用池重启脚本
    JS获取url参数及url编码、解码
    Jmeter压测Thrift服务接口
    浏览器插件及好用的小工具
    Jmeter入门实例
    BugBash活动分享
    如何作缺陷分析
  • 原文地址:https://www.cnblogs.com/lyz0925/p/6097619.html
Copyright © 2011-2022 走看看