swiftuikitimageviewstoryboardcontentmode

How to get rid of a jaggy ImageView border when scaling down a big image?


I have a bunch of round Images. They are in png with a 512x512 size. I took them from Flaticon.

To display images in a tableView I use imageView with a 45x45px size and Content Mode as Aspect Fit. Images put in a project assets.xcassets folder with a Scale property as Single Scale.

When images displayed by a tableView a jaggy border is visible in every image:

And its visible without zooming in:

Is it a problem with source images? How to make the image border smooth?


Solution

  • The issue is with an image that you have added. Please use a normal image and give corner radius to image view as below

    self.imageFlag.layer.cornerRadius = self.imageFlag.frame.size.height/2
    

    This will resolve your issue Below is the screenshot enter image description here