I'm trying to make table view with two labels and an image in the middle. The image is fetched asynchronously from the web, and after it is fetched I want to make the UIImageView's frame to fit the size of the image, and fit the table view's width. I have set autolayout: for each label and for image only top, bottom, leading and trailing space, no height constraint.
I've set rowHeight and estimatedRowHeight in the controller:
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 333.0
After the images are fetched, extra padding appers above and below the image (I've se the background color of image view to red, to clearly see it):
Could you help me so that there's no extra padding in the image view, but it fits the size of the image?