I have a TableView whose first element is a fixed aspect ratio header image. I embedded a UIImageView inside the UITableViewCell's Content View. The desired outcome is the entire cell adopting the size of the image. I tried a couple of things, first of all, pinning all four edges of the UIImageView to the parent Content View and setting the aspect ratio to my desired value (2h by 3w). With this setup the aspect ratio constraint gets completely ignored and the image view takes up the height of the cell, which shrinks my asset. Next, I tried to remove the bottom constraint. As a result, the aspect ratio is respected, but the cell height is larger than that of the image view.
My question is, can I make the cell shrink to wrap the height of the image view using auto layout?