Enrique
Enrique

Reputation: 303

Constraints not working in TableViewCell

I'm learning how to use CoreData to store images, and I'm making a blog reader. I have a view That shows all the info saved as a list and when you click it takes you to that article. My problem is that I can't make TableViewCells look as intended. I have added the constraints and not a single of them is being placed.

Here are my constraints: enter image description here

And this is the result: enter image description here

I've deleted them, cleaned, closed xCode, put them again and the same result. Found this answer, checked and nothing. Also this one. In the same project, I have another TableView and it works fine, any ideas why this is happening? Thanks a lot!

Upvotes: 0

Views: 382

Answers (2)

Ganesh Manickam
Ganesh Manickam

Reputation: 2139

It seems like issue not because of constraints. it because of image to solution for this issue

You have two option to solve this

1) Via code

cell.YOUR_IMAGE_VIEW.clipsToBounds = true

2) Via Interface Builder

enter image description here

Hope this will help you

Upvotes: 0

Bilal
Bilal

Reputation: 19156

Looks like image is overflowing form the container. Try this

  1. Set the UIImageView content mode to UIViewContentModeScaleAspectFill
  2. Set UIImageView clipToBounds to true.

Upvotes: 1

Related Questions