- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ... dance right here ... [tableView reloadData]; }
iOS: Deselecting UITableViewCell with AutoLayout
on
Thursday, February 12, 2015
Keywords:
AutoLayout
,
Fix
,
iOS
,
Objective-C
,
UITableView
0
comments
You'll notice that when deselecting a customized UITableViewCell using tableView-deselectRowAtIndexPath:animated: method inside tableView-didSelectRowAtIndexPath: method is that its contentView gets misplaced. It's probably halfway up the cell. I really think there's a bug on this area for Apple to adress. In the meantime, to work around this bug, you only need to replace the tableView-deselectRowAtIndexPath:animated: method call with tableView-reloadData. Yes it is. And for as long you don't have such a complicated tableView and cell structure, worry not about the performance.