forkingdog / UITableView-FDTemplateLayoutCell

Template auto layout cell for automatically UITableViewCell height calculating
MIT License
9.93k stars 2.01k forks source link

约束问题 #304

Closed xlsd closed 7 years ago

xlsd commented 7 years ago

在demo工程中添加movecell的方法,例如把第5个cell置顶。那么再次滚动tableView,所有的缓存高度就全乱了。

- (void)moveWithIndexPath:(NSIndexPath *)indexPath {
    if (!indexPath) return;
    [self.feedEntitySections[0] insertObject:self.feedEntitySections[indexPath.section][indexPath.row] atIndex:0];
    [self.feedEntitySections[indexPath.section] removeObjectAtIndex:indexPath.row];

    [self.tableView moveRowAtIndexPath:[NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section] toIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
}
xlsd commented 7 years ago

对不起,是我逻辑错误。