Reputation: 3291
The constraints for the image view inside Table view cell gets distorted on scroll.
The constraints are fine on initial load and view. Once the table view cell goes out of the view and we scroll back to get it, the image view gets displaced.
This is the screenshot of single TableViewCell. The globe icon is misplaced from its original spot (left of name and designation) and overlaps on the text below.
Screenshot of prototype cell from storyboard
The black lines show the constraints added on the storyboard. Using XCode 8.0 with Swift 3. I am doing something wrong with the constraints ?
Upvotes: 0
Views: 1203
Reputation: 33036
It seems that you are missing a height constraint on the image view. Should be able to fix problem if you add that.
Also, maybe related as well, can you set your image view's content mode to aspect fit? Sometime like this:
ObjC
[self.imageView setContentMode:UIViewContentModeScaleAspectFit];
Swift
self.imageView.contentMode = .scaleAspectFit
Upvotes: 1