正如在iPhone Mail应用程序中所做的那样,我希望在从右到左滑动一个可编辑的表格单元时出现"删除"按钮,以便在它被解除时进行动画处理(通过点击其上的"删除"按钮以外的其他方式UITableViewCell).相反,我的删除按钮会在解除时立即消失.
要在第一个位置刷一个表格单元格时调用"删除"按钮,我已添加(对于该类UITableViewDataSource和UITableViewDelegate该UITableView问题的类):
// 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
}
}
Run Code Online (Sandbox Code Playgroud)
我可以添加一些东西来处理删除按钮的动画吗?谢谢!