我正在使用那种笔记应用程序,我想添加要删除的选项(如iPhone的默认笔记应用程序)。我实施了以下两种表格视图方法..如何在iOS中用动画隐藏UITableView的删除按钮?
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
//Action to delete value of the cell
}
}
除了动画以外,一切正常。在滑动动作上显示删除按钮时发生动画,同时隐藏动画(通过点击或滚动表格视图)不会与动画发生。删除按钮刚刚消失。
我可以使用动画显示删除按钮的隐藏过程吗?
@property编辑 当你刷卡那么可能是你的表reload.just检查。 – 2013-04-22 12:42:01
不,表格视图在刷单元时不会重新加载。在滑动操作中只调用了canEditRowAtIndexPath:方法。 – Confused 2013-04-22 12:55:20
问题是,cell.textLabel.text应该保留一些值。 http://stackoverflow.com/questions/4981953/how-can-i-animate-the-dismissal-of-a-uitableview-swipe-to-delete-button – Confused 2013-04-23 04:56:32