我有一个自定义的 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/