1、正常情況下我們只要設置這三個刷新為零就可以了
tableView.estimatedRowHeight = 0;
tableView.estimatedSectionFooterHeight = 0;
tableView.estimatedSectionHeaderHeight = 0;
2、如果和我一樣使用的是自動計算行高 ,那么estimatedRowHeight就必須不為0。把預估行高也設置為自動計算 UITableViewAutomaticDimension 就可以了,完美!
tableView.rowHeight = UITableViewAutomaticDimension;
tableView.estimatedRowHeight = UITableViewAutomaticDimension;
tableView.estimatedSectionFooterHeight = 0;
tableView.estimatedSectionHeaderHeight = 0;