为什么uitableview单元格保持高亮显示? [英] Why does uitableview cell remain highlighted?
本文介绍了为什么uitableview单元格保持高亮显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
触摸后会导致tableview单元格保持高亮显示的是什么?我单击单元格,可以看到它保持突出显示为细节视图推。一旦细节视图弹出,单元格仍然突出显示。
What would cause a tableview cell to remain highlighted after being touched? I click the cell and can see it stays highlighted as a detail view is pushed. Once the detail view is popped, the cell is still highlighted.
推荐答案
在 didSelectRowAtIndexPath
中,您需要调用 deselectRowAtIndexPath
以取消选择单元格。
In your didSelectRowAtIndexPath
you need to call deselectRowAtIndexPath
to deselect the cell.
因此,在 didSelectRowAtIndexPath
你只需要调用 deselectRowAtIndexPath
。
So whatever else you are doing in didSelectRowAtIndexPath
you just have it call deselectRowAtIndexPath
as well.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Do some stuff when the row is selected
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
这篇关于为什么uitableview单元格保持高亮显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文