user4422315
user4422315

Reputation:

UIImage bigger than constraints dimensions

enter image description here

My constraints :

width = 100 height = 100

I'm using SDWebImage, the images look nice at first and then they grow bigger.

I am not sure how to use hugging and compression auto layout for sizing priorities.

Upvotes: 0

Views: 271

Answers (2)

V M V D Nagendra
V M V D Nagendra

Reputation: 1

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{
    let cell = taBleView.dequeueReusableCell(withIdentifier: "cell") as! TableViewCell

    cell.imageview.clipsTobounds = true

Upvotes: 0

Shehata Gamal
Shehata Gamal

Reputation: 100503

You need to set

self.imageView.clipsToBounds = true

Upvotes: 1

Related Questions