I've 3-5 dataSource and in ViewDidLoad() I've mentioned the property for dynamic cell height:-
[self.tableView setEstimatedRowHeight:40.0];
[self.tableView setRowHeight:UITableViewAutomaticDimension];
but the tableview don't update accordingly.. first two-three cell shows contents in good way but as soon as I scroll the tableview, cell gets compressed and then cell shows half of the content.
UPDATED
screen of customCell is tableViewCell andConstraints Are:tableViewCellConstraint I have a UIView in cell and label and a uiimageview inside the view
More Update::
I think its coz i'm also using an empty cell to have a space between two cell and in the delegate method for i doing this
-(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 20.0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row %2 == 0) {
return 15;
}
return UITableViewAutomaticDimension;
}