When you tap a row in a UITableView
, the row is highlighted and selected. Is it possible to disable this so tapping a row does nothing?
转载于:https://stackoverflow.com/questions/190908/how-can-i-disable-the-uitableview-selection
When you tap a row in a UITableView
, the row is highlighted and selected. Is it possible to disable this so tapping a row does nothing?
转载于:https://stackoverflow.com/questions/190908/how-can-i-disable-the-uitableview-selection
For me, the following worked fine:
tableView.allowsSelection = NO;
This means didSelectRowAt#
simply won't work. That is to say, touching a row of the table, as such, will do absolutely nothing. (And hence, obviously, there will never be a selected-animation.)
(Note that if, on the cells, you have UIButton
or any other controls, of course those controls will still work. Any controls you happen to have on the table cell, are totally unrelated to UITableView's ability to allow you to "select a row" using didSelectRowAt#
.)