I am trying to turn a square image into a circle. I am using this code to do it:
profilePicture2.layer.cornerRadius = profilePicture2.frame.size.height/2
profilePicture2.clipsToBounds = true
It works perfectly, until I try centre the image in the container view by adding a 'Align centre X to superview' constraint. When I add this constraint I simply get very rounded corners instead of a circle.
In fact, it seems to half the value of the corner radius. So if the image has a height of 100, and corner radius should be set to 50, it LOOKS like the radius value is set to 25.
No other constraints have been added to the image.
What is going on here?