Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableViewCell setSelected, but selection not shown

I want to keep a cell selected, and only change when I select another cell. In tableView:cellForRowAtIndexPath: I have set a selected cell with [cell setSelected:YES]. I know the cell is selected, but it is not shown. When I call [tableView reloadData] the selected cell flashes.

Any ideas?

like image 464
willi Avatar asked Mar 23 '10 15:03

willi


1 Answers

You should use selectRowAtIndexPath:animated:scrollPosition: instead of the selected property for UITableViewCell

See sample UICatalog and read UITableView reference

like image 51
Victor Avatar answered Oct 03 '22 03:10

Victor