Home > DeveloperSection > Forums > How can I disable the UITableView selection highlighting?
Nigel Bunyan
Nigel Bunyan

Total Post:20

Points:140
Posted on    September-01-2015 12:05 AM

 iPhone iPhone  Ios  Objective C 
Ratings:


 1 Reply(s)
 772  View(s)
Rate this:
I have created an application using UITableView, but now when I tap a row in a UITableView, the row is highlighted and selected.
Is it possible to disable this so tapping a row does nothing?


Tarun Kumar

Total Post:213

Points:1635
Posted on    September-02-2015 12:07 AM

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.


Don't want to miss updates? Please click the below button!

Follow MindStick