//先要设Cell可编辑 -(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"xxxxfffwefw"); return YES; } //修改编辑按钮文字 - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath { return @"删除"; } - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { /* if(indexPath.row ==0) { [tableView setEditing:YES animated:YES]; //这个是整体出现 } */ return UITableViewCellEditingStyleDelete; } //进入编辑模式,按下出现的编辑按钮后 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"touchIIddddd"); /* if(indexPath ==0) { [tableView setEditing:NO animated:YES]; } */ }
转载于:https://www.cnblogs.com/qingjoin/archive/2012/10/31/2747453.html
本文深入讲解了如何在UITableView中设置单元格为可编辑状态,包括修改编辑按钮的文字、设定编辑样式以及处理编辑模式下的操作。通过示例代码,读者可以了解到如何在iOS应用中实现自定义的表格视图编辑功能。
6395

被折叠的 条评论
为什么被折叠?



