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

  • 相关阅读:
    3D数学 矩阵的更多知识(5)
    D3D中的光照(1)
    双节棍(C语言版)
    D3D中的Alpha融合技术(1)
    D3D编程必备的数学知识(5)
    Direct3D中的绘制(1)
    初始化Direct3D(2)
    D3D中的纹理映射(2)
    Direct3D中的绘制(1)
    D3D编程必备的数学知识(2)
  • 原文地址:https://www.cnblogs.com/lyz0925/p/6097619.html
Copyright © 2011-2022 走看看