zoukankan      html  css  js  c++  java
  • uitableview 左右滑动删除cell

    1.自定义cell    添加  scrollview    ,scrollview上添加显示数据的控件

    2.scrollview的宽度要大于tableview的宽度

     

    -(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate

    {

        if (scrollView.contentOffset.x > 80) {

            scrollView.contentInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, scrollView.contentOffset.x);

                  if (self.delegate && [self.delegate respondsToSelector:@selector(Protocol_historyCellDelete:)])

            {

                [self.delegate Protocol_historyCellDelete:self];

            }

        }

       

    }

     

    -(void)Protocol_historyCellDelete:(JECP_SearchHistoryTableViewCell *)cell

    {

        NSIndexPath *indexPath = [tbv_list indexPathForCell:cell];

        int row = indexPath.row;

        [nma_list removeObjectAtIndex:row];

        [tbv_list deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft];

           

    }

     

  • 相关阅读:
    管理反思(阶段)
    应用软件系统程序员的三个立面
    再优秀那么一点点
    TCP相关时延
    go wiki整理1
    慢就是快
    给自己一点机会
    竞争
    go mem
    币圈再次过年
  • 原文地址:https://www.cnblogs.com/madaha/p/4382320.html
Copyright © 2011-2022 走看看