I am trying to use the background property of my collection view cell to display an image. The problem is :
If my image is not squared, to be sure that it is not deformed, I use the .ScaleToFill property, but when I run the picture overflow the cell frame.
Is there a way to fix it ?
Thank you !
答案 0 :(得分:1)
You should set clipToBounds = true
答案 1 :(得分:0)
Okay, never mind.
I just had to add the following line after the background view set.
cell.clipsToBounds = true