我希望像iPhone邮件应用程序一样,当从右向左滑动可编辑表格单元时出现的“删除”按钮能够在被取消(通过点击除UITableViewCell
上的“删除”按钮以外的其他地方)时动画消失。但是,我的删除按钮在被取消时立即消失。
为了在第一次滑动表格单元时调用“删除”按钮,我已经在作为所涉及UITableView
的UITableViewDataSource
和UITableViewDelegate
的类中添加了以下内容:
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
//add code here for when you hit delete
}
}
我能添加些什么来处理删除按钮在被消除时的动画效果吗?谢谢!