My constraints are not working inside a UITableViewCell, although there are no warnings and the layout is working in interface builder if I change between devices and do rotation.
What did I do:
I created a UITableViewCell called SearchResultCell. I want to layout a button on the right hand side and two labels on the left and the labels should horizontally fill the entire space until the button.
Initially, I just placed the views there and - no matter which constraints I defined - in the simulator all views always appeared at the top left corner.
Then I tried embedding them into stack views. The two labels into a vertical stack view which I then put together with the button into a horizontal stack view. Then I defined constraints such that the outmost stack view should fill the entire superview, i.e. I set bottom, trailing, top, and leading constraints to 0.
Again, in interface builder it is always shown correctly:
Layout works correctly in interface builder
However, once launched, these constraints do not seem to be applied.
How it looks like in simulator
The only (slight) improvement is that now the button is beside the label thanks to the stack view. But no matter what I try, I cannot get the constraints working inside this UITableViewCell.
What am I doing wrong here? I don't see it.