cyclingIsBetter
cyclingIsBetter

Reputation: 17591

Do not highlight table view row when touched

When I select a row of a table view, it becomes blue. I want the row to not change color when I touch it. How can I do this?

Upvotes: 3

Views: 1796

Answers (3)

Ken
Ken

Reputation: 572

Under the cellforrowatindexpath, assign a variable to the 'cell' object

cell.selectionStyle = UITableViewCellSelectionStyleNone;

Upvotes: 0

Tyler
Tyler

Reputation: 28864

If you want to disallow selection of all rows in your table, then in the setup of your table's view controller (such as in viewDidLoad), set

self.tableView.allowsSelection = NO;

Reference: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html

Upvotes: 1

Michael Behan
Michael Behan

Reputation: 3443

each cell will need one of these:

cell.selectionStyle = UITableViewCellSelectionStyleNone;

Upvotes: 6

Related Questions