zoukankan      html  css  js  c++  java
  • iOS 10 设置TableViewCell侧滑时,当Cell上有按钮的点击事件,当Cell进入编辑状态的时候取消按钮的点击事件

    //定义编辑样式

    - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {

        JKDZMTGoodBaseCell * cell = (JKDZMTGoodBaseCell *)[tableView cellForRowAtIndexPath:indexPath];

        cell.coverImg.enabled = NO;

        return UITableViewCellEditingStyleDelete;

    }

    - (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath{

        MyLog(@"开始进入编辑状态");

        

        JKDZMTGoodBaseCell * cell = (JKDZMTGoodBaseCell *)[tableView cellForRowAtIndexPath:indexPath];

        cell.coverImg.enabled = NO;

        

    }

    - (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(nullable NSIndexPath *)indexPath{

        MyLog(@"结束编辑状态")

        JKDZMTGoodBaseCell * cell = (JKDZMTGoodBaseCell *)[tableView cellForRowAtIndexPath:indexPath];

        cell.coverImg.enabled = YES;

    }

    //修改编辑按钮文字

    - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {

        return @"删除";

    }

  • 相关阅读:
    php 数组分页
    Fchart
    thinkphp对数据库操作有哪些内置函数
    MySQL性能优化的最佳20+条经验
    apache 简单笔记
    PHPMyadmin 配置文件详解(配置)
    mysql 常用知识
    分布式微服务日志的配置
    分布式微服务的配置
    分布式接口的调用
  • 原文地址:https://www.cnblogs.com/Jackie-subDai/p/9341704.html
Copyright © 2011-2022 走看看