I'm trying to use a stackview inside a tableview cell. My stack view has two labels aligned horizontally. I've added a size class override in IB to align the labels vertically for compact width.
The alignment of the label does change as expected but the height of the cells is incorrect until I scroll cells out and back in.
My table view specifies to calculate the height of the cell using:
// Automatic row height calculation
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 68.0 // set to whatever your "average" cell height is
So, in an iPhone SE, I want the labels side by side in landscape but one on top of the other in portrait. If I start my app in portrait mode the labels are as expected but when I rotate to landscape they move to side by side but the cell still has the height as in portrait. If I scroll cells off the screen then the cell height is corrected.
What am I missing?
Please help.
Thanks.