我有一个可编辑的 UITableView。默认情况下,用户可以滑动并显示删除按钮。发生这种情况时,我想在我的 UITableView 单元格上隐藏一些元素。我该怎么做?
最佳答案
来吧:
tableView:willBeginEditingRowAtIndexPath:
...
Discussion
This method is called when the user swipes horizontally across a row; as a consequence, the table view sets its editing property to YES (thereby entering editing mode) and displays a Delete button in the row identified by
indexPath
. In this "swipe to delete" mode the table view does not display any insertion, deletion, and reordering controls. This method gives the delegate an opportunity to adjust the application's user interface to editing mode. When the table exits editing mode (for example, the user taps the Delete button), the table view callstableView:didEndEditingRowAtIndexPath:
.
然后扔一些[[cell viewWithTag:<#View's tag number#>] setHidden:YES]
发表自己的看法。
关于iphone - 如何检测用户何时滑动了可编辑的 UITableViewCell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7275450/