No animation when deselecting UITableViewCell
I'm using Loren Brichter's FastScrolling UITableView subclass in my iOS app, and I have a problem properly deselecting the cells in the table view, when it's pushed back on top of the stack. My viewWillAppear
method looks like this:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:YES];
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSele开发者_StackOverflowctedRow] animated:YES];
}
The cell is deselected, but without any animation. How can I fix this?
Update
If I remove the code above, the exact same thing happens. Could it be that a new instance of the table view is added on top of the old every time the view is pushed on top of the stack?
because your cell is probably deselected before your deselect-call and you are deselecting in the viewWillAppear
-method. So at this moment the view is not visible.
try to use your code in viewDidAppear
.
精彩评论