IOS 8.3 breaks auto cell height

Long time reader, first time poster.

I am using auto cell height with auto layout in my application. In iOS 8.3 and 8.4, this seems to be broken. I have a sample project. When built in 8.2 or below, it works correctly. The height of the cells is determined by the auto-off method. When built in 8.3 or 8.4, it won't work. I have searched the web and I don't see anyone posting this issue.

Take a look at the screenshots below. Any help is appreciated.

Cell size zip

Screenshot comparison http://jeffburg.com/skitch/CellHeightProjectComparison.png

Thank! -Jeff

+3


source to share


3 answers


I checked your code and found the problem.

Reading through AppCodas an article on self- sizing items, it looks like you should be using estimatedRowHeight

when using UITableViewAutomaticDimension

(haven't used it myself, can't confirm). So either remove the following line:

self.tableView.rowHeight = UITableViewAutomaticDimension

      



or add (if your cell height will change based on content):

self.tableView.estimatedRowHeight = 122;

      

+3


source


I had the same problem in my iOS> 8.3 project. I fixed your sample by executing delegate methods instead of setting rowHeight to viewDidLoad. This is definitely a UITableView related bug, so you haven't done anything wrong.



+1


source


Add this method to your delegate:

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewAutomaticDimension;
}

      

0


source







All Articles