UITableView将某些单元格设置为“不可选择” [英] UITableView Setting some cells as "unselectable"
本文介绍了UITableView将某些单元格设置为“不可选择”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将UITableView的单元格属性设置为不可选?当用户点击单元格时,我不希望看到蓝色选择框。
How can I set the UITableView's cell property to be unselectable? I don't want to see that blue selection box when the user taps on the cell.
推荐答案
设置表格单元格的 selectionStyle
属性为 UITableViewCellSelectionStyleNone
。这应该可以防止它突出显示,你也可以检查 tableView中的属性:didSelectRowAtIndexPath:
。
Set the table cell's selectionStyle
property to UITableViewCellSelectionStyleNone
. That should prevent it from highlighting, and you can also check that property in your tableView:didSelectRowAtIndexPath:
.
这篇关于UITableView将某些单元格设置为“不可选择”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文