I am working on dynamic cell in my tableView and give it these two function:
-(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 100;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return UITableViewAutomaticDimension;
}
And I pin my label to the top and bottom of the cell.
The conflict is: When I run the code for the first time there is no dynamic cell and give wrong height.
When I'm scrolling down and return it convert to dynamic cell.
I used:[self.tableView reloadRowsAtIndexPaths:rowsToReload withRowAnimation:YES];
in the function: (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath
Can anyone explain what happened to my view?