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?

 

 

For me, the following worked fine:

 

tableView.allowsSelection = NO;

 

All you have to do is set the selection style on the UITableViewCell instance using either:

cell.selectionStyle =UITableViewCellSelectionStyleNone;

or

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];

Further, make sure you either don't implement -tableView:didSelectRowAtIndexPath: in your table view delegate or explicitly exclude the cells you want to have no action if you do implement it.

 

文章標籤
全站熱搜
創作者介紹
創作者 pcwiki 的頭像
pcwiki

pcwiki的部落格

pcwiki 發表在 痞客邦 留言(0) 人氣(40)