I\'ve spent several days trying to figure this out, but there doesn\'t seem to be a solution. I have a very basic UITableView cell with two labels in it. One of them will be
As of iOS 9.1 UIStackView
doesn't implement intrinsicContentSize:
so the table view can't calculate the height of each cell, thus they are displayed at the estimated height instead.
So, ideally you would simplify your code to mean you don't use a stack view and you don't keep adding and removing (and creating and destroying) views all the time. The root of the solution is to not use a stack view though.
You can continue to use a stack view if you want, but you'll need to create a subclass and implement intrinsicContentSize:
. Your reason for using the stack view shouldn't be required though as you can configure the constraints to match first baselines.