iphone - UITableviewCell 取消选择回调

标签 iphone objective-c ios ipad

我有一个自定义的 UItableviewcell(我已经对其进行了子类化)。我必须在选择时更改它的选择样式,并在选择其他单元格时还原更改。我有一个回调 setSelectionStyle,我可以在其中更改外观以显示它已被选中,但我没有回调来恢复该更改。

知道苹果如何从 UItableviewcell 中删除蓝色选择层吗?

最佳答案

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {


   /*

     All required implementation with the selected row 

   */

    // Use the following code to deselect the row.
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

注意:不要忘记在您的 .m 文件中添加 tableview 委托(delegate)。

关于iphone - UITableviewCell 取消选择回调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12082773/

相关文章:

iphone - INFINITY 划分时的问题是 iOS

iPhone以编程方式裁剪方形图像以显示为圆形

ios - 从相机拍摄的 iphone 图像自动旋转 -90 度

ios - Firebase 可以在 iOS 7 后台发送和接收吗?

iphone - 删除应用程序然后重新安装时的 iOS 推送通知行为

iphone - iOS 应用程序中的代码重用

iphone - ARC 警告 - "Not safe to remove an unused autorelease"

ios - 如何根据内容动态设置 tableview 的高度,但它应该与底部按钮保持最小距离?

ios - 沿用户面向的方向旋转 GMSMarker

iphone - 配对dispatch_resume和dispatch_suspend以强制终止应用程序