Using cornerRadius on a UIImageView in a UITableViewCell

前端 未结 4 1092
情歌与酒
情歌与酒 2021-01-31 11:55

I\'m using a UIImageView for each of my UITableViewCells, as thumbnails. My code uses SDWebImage to asynchronously grab those images from

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-31 12:28

    There is another good solution for this. I did it a few times in my projects. If you want to create a rounded corners or something else you could just use a cover image in front of your main image.

    For example, you want to make rounded corners. In this case you need a square image layer with a cut out circle in the center.

    By using this method you will get 60fps on scrolling inside UITableView or UICollectionView. Because this method not required offscreen rendering for customizing UIImageView's (like avatars and etc.).

提交回复
热议问题