发个广告:ios开发两年了,一步步走来 关注公众号一起进步
左滑删除
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
returnYES;
}
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle ==UITableViewCellEditingStyleDelete) {
[self.courseArrayremoveObjectAtIndex:indexPath.row];
[self.ui_tableViewdeleteRowsAtIndexPaths:[NSArrayarrayWithObject:indexPath]withRowAnimation:UITableViewRowAnimationFade];
}
}
本文分享了作者两年iOS开发的经验,并重点介绍了如何在 iOS 应用中使用 UITableView 控件实现列表项的左滑删除功能。包括如何设置 UITableView 的可编辑属性及实现删除操作的具体方法。

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



