I am trying to create a border around my UIIMageView which is a perfect circle using cornerRadius. Everything i've looked at says my code is correct, but it returns more of a diamond shape. (i've imported quartzCore, not sure I needed to)
image.layer.cornerRadius = (image.bounds.size.width/2);
image.layer.borderWidth = 5;
image.layer.borderColor = [UIColor whiteColor].CGColor;
Any ideas?
image.layer.cornerRadius = image.frame.size.width /2;
image.layer.masksToBounds = YES;
image.layer.borderWidth = 5;
image.layer.borderColor = [UIColor whiteColor].CGColor;
The height and width of your imageview must be equal
Have you tried to add:
image.layer.masksToBounds = YES;
Another thing: is the width of your image equal to its height?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With