---恢复内容开始---
主要是通过两个代理方法:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if ([[self.selectArray objectForKey:indexPath] isEqual: @"100"]) { return 100; }else { return 44; } } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if (cell.frame.size.height == 44) { [self.selectArray setObject:@"100" forKey:indexPath]; }else { [self.selectArray removeObjectForKey:indexPath]; } [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; }
---恢复内容结束---
原文:http://www.cnblogs.com/developzhou/p/5036575.html