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

           

    }

     

  • 相关阅读:
    第三个Sprint冲刺第三天
    回答第1-17章
    阅读第13-17章
    阅读第10、11、12章
    阅读第8,9,10章
    作业5.2 5.3
    四则运算 测试与封装 5.1
    阅读第5-7章
    阅读1-5章
    我给队友做的汉堡包
  • 原文地址:https://www.cnblogs.com/madaha/p/4382320.html
Copyright © 2011-2022 走看看