I've been trying to figure this out for days. I can't get the constraints to work on this UITableViewCell. These are the constraints I have.
but it comes out like this
The red is the cell background, cyan is the UIImageView background, green is the title Label, and blue is the percentage Label. How do I fix this? I want to make the row height the same as the image height in the UIImageView but the constraints are making the cell display it's subviews in a way I don't want. I want each cell layout to look exactly like the pictures of the cell I posted.
Firstly, try to always set constraints to closest view. You have set the bottom constraint of title to the progressbar, for this reason you can see the green view behind the blue. Add the bottom constraint of title to percentage top.
Then, add the constraints of the image to top, bottom and leading, then add the aspect ratio constraint.
In your code add an height to the cell like how you do think it's better.