
I'm trying to achieve something similar to the 9gag app where the cells automatically resize based in the size of the image. The width hugs the sides but the height is resized as needed.
I have a Label that consists of the title above it as well as a UIImageView and below the image I have share icons etc. I've set the constraints for the image to be the UIImageView and to the lower share icons as well as to both leading and trailing spaces. It seems like I've tried every combination of switching "Mode" of the view (i.e. aspect fill, aspect fit) when I do aspect fit it sizes the images correctly but adds a bunch of padding to both the lower and upper parts of the image (screenshot included below)
The label and icons all have the appropriate constraints set (as far as I can tell)
I've searched for hours trying to find someone with a similar issue but to no avail I can't seem to find anything in regards to self sizing cells that use images that may vary in size.
Can anyone point me in the right direction or know of the solution to my problem? All help is very much appreciated as always!