Mike_NotGuilty Mike_NotGuilty - 1 year ago 91
iOS Question

iPhone - UITableViewCell white after selected

How is it possible that my UITableViewCell (Static cells) after i selected it become white again? When i tap on it , it becomes grey and stays grey! It should be grey for a short time if i tap on it.



Normally when you tap on a UITableViewCell - the background color of the cell turns grey for a short time. But my problem is in my application, when i tap on the cell, the background color of the cell stays grey. And I don't know how to solve this problem.

Answer Source

You need to deselect the cell in the didSelectRowAtIndexPath method.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // do stuff

    [tableView deselectRowAtIndexPath:indexPath animated:YES];