I'd like to add a corner radius and a drop shadow to a UIImageView
in Swift. I don't know how to do that because when adding the corner radius, I either have to set clipsToBounds
or masksToBounds
to true. As a consequence, I am not able to draw a shadow.
Asked
Active
Viewed 61 times
0

j3141592653589793238
- 1,810
- 2
- 16
- 38
-
I don’t think this is a duplicate. This refers to UIImageViews. If I don’t set clipsToBounds or masksToBounds, my image won’t have rounded corners. @rbaldwin – j3141592653589793238 May 01 '18 at 19:54
-
UIView has a layer property that has a contents property on it that you can use to set images. You can then round the corners of the layer. – Lance Samaria May 01 '18 at 20:10
-
Hmm, thanks. Could you show an example? @LanceSamaria – j3141592653589793238 May 01 '18 at 20:21