ios - 如何在 UITableView 单元格中设置启用的用户交互

标签 ios uitableview

我正在使用 UITableview(分组)。我在 xib 中禁用了用户交互。但是,我想启用一个单元格的交互。我怎样才能启用它?我使用了 [cell setUserInteractionEnabled:yes] 但它不起作用。 -tableView didselectrowindexpath 未被调用。任何人都可以建议我。提前致谢

最佳答案

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    //Configure the cell

     if (indexPath.row == yourcell)
       cell.userInteractionEnabled = YES;
}

希望对你有帮助

关于ios - 如何在 UITableView 单元格中设置启用的用户交互,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10533486/

相关文章:

ios - 如何在我的 iOS 应用程序中实现该功能?

ios - 在 iOS 中声明条件委托(delegate)方法

ios - 在 iOS 中的 Instagram 上分享多张图片

ios - 是否可以将 `map` 枚举到 SwiftUI 中的 Binding<Bool> ?

ios - 使用 if 语句将一张图像添加到特定的 UICell 将其添加到多个 UICell Objective-c

ios - 无法使用 json 数据填充 UITableview

ios - 如果屏幕锁定,点击暂停按钮时 avplayer 不会暂停

ios - 使用 do while 循环设置背景加载

ios - 在 Controller 之间传递数据的最佳性能

ios - TableView 复制上的复选框,Swift,iOS