iphone - UITableView : detecting click on '-' button in edit mode

标签 iphone objective-c cocoa-touch uitableview

在我的 iPhone 应用程序中,我有一个处于编辑模式的 UITableView,其中包含自定义 UITableViewCell。 我想检测用户何时在“删除”按钮出现之前单击了每个单元格的左按钮(减去圆形红色按钮,旋转动画按钮)。

在这种情况下,我希望能够更改我的单元格内容...

这可能吗?

谢谢!

最佳答案

您可以将实现 -willTransitionToState: 和/或 -didTransitionToState: 方法的 UITableViewCell 子类化。

willTransitionToState: Subclasses of UITableViewCell can implement this method to animate additional changes to a cell when it is changing state. UITableViewCell calls this method whenever a cell transitions between states, such as from a normal state (the default) to editing mode. The custom cell can set up and position any new views that appear with the new state. The cell then receives a layoutSubviews message (UIView) in which it can position these new views in their final locations for the new state. Subclasses must always call super when overriding this method.

关于iphone - UITableView : detecting click on '-' button in edit mode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2448583/

相关文章:

objective-c - 从 UIPanGestureRecognizer 获取原始触摸位置

ios - 保护 iPhone 数据的常见做法是什么

iPhone ivar 命名约定

ios - 如何编辑使用 dequeueReusableCellWithIdentifier 后在新单元格中自动创建的文本标签

iphone - 识别绘制图像的最佳方法

ios - 从 NSArray、KVC 获取最大日期

iphone - 在 iOS 应用程序中获取全局 IP 地址和国家/地区是否合法?

ios - UITableView 或 UICollectionView 提供类似 Siri 的简单用户体验

ios - UINavigationController 和 UINavigationItem 的辅助功能

cocoa-touch - RootViewController 中 UITableView 的 float View