I am trying to use AutoLayout to configure the subviews in my table view cells and in the ideal case would like the table view cell to be just as high as necessary to contai
Now that you've uploaded the example to github, I was able to see that the constraints were in fact over-determined. There was too much "this is equal to that", esp. in the area of vertical spacings/heights. I simplified the constraints, and was able to change to your code to this:
-(CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0)
{
return 44;
} // else
UITableViewCell* cell =
[tableView dequeueReusableCellWithIdentifier:@"LargeCell"];
CGSize sz =
[cell.contentView systemLayoutSizeFittingSize:UILayoutFittingExpandedSize];
return sz.height;
}
If I'm not mistaken, that's exactly the sort of thing you are after, i.e. to let the constraints themselves dictate the height of the cell.