Search code examples
ioscssuitableviewsdwebimage

The width of images in UITableViewCell changes to the click


@nathan this is my entire controller. My problem is that when I click a tableview cell, the image size is changed and becomes too long. I can not figure out how to fix the size, I tried everything. To do URL parsing, I used NSXMLParser, while I used SDWebImage to load images into cells.

When I press an element its size changes. Like this:

enter image description here

enter image description here

How to fix?


Solution

  • That seems like a content mode issue. Set the imageView's contentMode to aspectFit/aspectFill (depends on what you want to achieve)