zoukankan      html  css  js  c++  java
  • tableview 删除row ,删除组

    [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];

    删除行

    -(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

    {

        if (editingStyle==UITableViewCellEditingStyleDelete) {

            //        获取选中删除行索引值

            NSInteger row = [indexPath row];

            //        通过获取的索引值删除数组中的值

            [self.arrayimg removeObjectAtIndex:row];

            //        删除单元格的某一行时,在用动画效果实现删除过程

           [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];

      

        }

    }

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

    {

        return UITableViewCellEditingStyleDelete;

    }

    [tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationAutomatic];

    删除组

    -(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

    {

        if (editingStyle==UITableViewCellEditingStyleDelete) {

            //        获取选中删除行索引值

    //        NSInteger row = [indexPath row];

            //        通过获取的索引值删除数组中的值

            NSInteger section = [indexPath section];

            [self.arrayimg removeObjectAtIndex:section];

            //        删除单元格的某一组时,在用动画效果实现删除过程

            //[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];

            [tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationAutomatic];

        }

    }

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

    {

        return UITableViewCellEditingStyleDelete;

    }

    挥毫泼墨,书写人生篇章
  • 相关阅读:
    配置wpa_supplicant调试wifi linux下命令行连接wifi
    Android平台开发-WIFI 驱动移植 -- 详细
    明远智睿IMX6Q Android4.4.2移植USBWIFI(RTL8188EUS)
    android上USB Wifi调试记录
    Android wifi驱动的移植 realtek 8188
    CCF-CSP-201703-4-地铁修建
    CCF-CSP-201709-4-通信网络
    CCF-CSP-201409-4-最优配餐
    CCF/CSP-201612-4-压缩编码
    CCF/CSP-201612-3-权限查询
  • 原文地址:https://www.cnblogs.com/Jusive/p/5828524.html
Copyright © 2011-2022 走看看