iphone - 如何检测用户何时滑动了可编辑的 UITableViewCell?

标签 iphone objective-c cocoa-touch uitableview

我有一个可编辑的 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 calls tableView:didEndEditingRowAtIndexPath:.

Reference

然后扔一些[[cell viewWithTag:<#View's tag number#>] setHidden:YES]发表自己的看法。

关于iphone - 如何检测用户何时滑动了可编辑的 UITableViewCell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7275450/

相关文章:

iphone - 如何获取一个巨大的视频文件的切片数据

iphone - cocos2d :how to create continous parallax layer

iphone - Xcode 4.3 如何保存我的应用程序屏幕区域?

objective-c - 将 UIWebview 限制在某些页面

ios - popViewControllerAnimated 更改 UINavigationBar 的 UIColor

objective-c - Xcode & 网页 View : Load local html if no internet connection (fallback)

iphone - 如何创建类似iPod播放器的 View ?

ios - 包含文件内容的字典在 ios 中不起作用

ios - 如何从音频 ViewController IOS7 返回后停止音频

iphone - CoreTelephony 框架 iOS 7