My app has a UITableView whose rows have a minimum height constraint based on class size. Specifically, rows have a minimum height of 45 in "any-any" and a minimum height of 65 in "regular-regular" (i.e. iPads). I've ensured the 45 height constraint is only installed for "any-any" and the 65 height constraint is only installed for "regular-regular."
I'm getting the "Unable to simultaneously satisfy constraints." warning during runtime on an iPad mini running iOS 8.3 due to the UIView-Encapsulated-Layout-Height constraint that iOS adds. I've read this SO Question but I don't think this problem is addressed there.
Here are the constraints that are in conflict:
"<NSLayoutConstraint:0x19116b00 V:|-(0)-[UILabel:0x19115fd0'text'] (Names: '|':UITableViewCellContentView:0x19115f00 )>",
"<NSLayoutConstraint:0x19116b30 V:[UILabel:0x19115fd0'text']-(0)-| (Names: '|':UITableViewCellContentView:0x19115f00 )>",
"<NSLayoutConstraint:0x191172c0 V:[UILabel:0x19115fd0'text'(>=65)]>",
"<NSLayoutConstraint:0x19087f30 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x19115f00(45)]>"
It appears to be using 45 to calculate the UIView-Encapsulated-Layout-Height constraint, even though the 45 height is not installed for regular-regular. In fact, it breaks the 65 height constraint and uses 45, making the rows short. When I scroll the rows off the screen and back in, their height is calculated correctly.
Note that I am using the following in ViewDidLoad:
self.tableView.rowHeight = UITableViewAutomaticDimension
self.tableView.estimatedRowHeight = 60.0;
I've tried setting the priority for the 65 height from 1000 to 750. It doesn't give the warning anymore, but the behavior is the same since it's using 45 for height.
I've even tried using "[self.tableView reloadData]" in ViewDidAppear, but it shows the wrong height briefly before resizing correctly.
Any ideas?