關(guān)于tableView刷新時(shí),刷新的位置與之前位置不符解決方案:
由于iOS 11新特性導(dǎo)致問題,目前自己已找到的解決方案:
以下三個(gè)屬性在 iOS11新特性下可以防止刷新tableView cell對(duì)應(yīng)不上
tableView.estimatedRowHeight = 0;
tableView.estimatedSectionHeaderHeight = 0;
tableView.estimatedSectionFooterHeight = 0;
也有人說可以用下面的這個(gè)方法可以解決,本人沒有測(cè)試這個(gè)方法
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
NSNumber *height = [self.cellHeightArray objectAtIndex:indexPath.row];
if (height) {
return height.doubleValue;
}
return UITableViewAutomaticDimension;
}