【问题标题】:setting target for disclosure button on subclassed UITableViewCell为子类 UITableViewCell 上的披露按钮设置目标
【发布时间】:2010-06-18 10:50:17
【问题描述】:

我创建了 UITableViewCell 的子类来创建一些自定义外观和 UI 功能(“滑动以显示删除按钮”)。

一些单元格是公开/详细信息公开类型,并手动添加了 UIButtonTypeDetailDisclosure 等。我不能在索引路径方法中使用表视图控制器的 UITableViewCellAccessory 行。

问题是,如何设置这些手动添加的按钮的目标,以便它们正确地将 didSelectRowAtIndexPath 发送到它们的表视图控制器?

【问题讨论】:

    标签: iphone objective-c uitableview


    【解决方案1】:

    没有直接的方法来设置附件披露按钮的操作。虽然你可以使用委托方法来做到这一点

    - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
    

    看看这是否有效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-14
      • 1970-01-01
      • 1970-01-01
      • 2012-01-25
      相关资源
      最近更新 更多