I am using some labels in a view. I want to make rounded corner label in my iphone application. I use following code to do this but it's not work. I got have some errors to use that properties.
label.layer.borderColor = [UIColor blueColor].CGColor;
label.layer.borderWidth = 4.0;
label.layer.cornerRadius = 8;
This simple code enough for RoundLabel
LabelName.layer.cornerRadius = LableName.frame.size.height/2;
LabelName.layer.masksToBounds = YES;
I was facing the same problem, using a UILabel with backgroundColor in a cell, and added this to work correctly :
label.layer.cornerRadius=8.0;
label.clipsToBounds=YES;
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