This would be impossible to explain without a project, hence I uploaded a small DEMO on GitHub.
I don't think the constraints are wrong. The image should be fixed in its place. Initially SDWebImage
retrieves the image from the cache, but once I click on the image, the image gets resized. (It gets smaller, see top image)
Funny enough in my demo the images show first as red squares. Once you click on them the imageView resizes and the actual image loads. This still shows the problem though.
It seems to me the initial cache is not resizing according to the constraints. Could that be true?
this fixes it:
[cell.imageView sd_setImageWithURL:imageURL
placeholderImage: nil
completed:^(UIImage image, NSError error, SDImageCacheType cacheType, NSURL *imageURL) {
[cell setNeedsLayout];
}];