UIlabel layer.cornerRadius not working in iOS 7.1 UIlabel layer.cornerRadius not working in iOS 7.1 ios ios

UIlabel layer.cornerRadius not working in iOS 7.1


Set the property clipsToBounds to true

addMessageLabel.clipsToBounds = true


I think the best way to set corner radius is:

enter image description here

and be sure the "Clip Subviews" is checked:

enter image description here

Checking "Clip Subviews" is equal to the code addMessageLabel.clipsToBounds = YES;.


Try the followings,

[[addMessageLabel layer] setCornerRadius:5.0f];[[addMessageLabel layer] setMasksToBounds:YES];//or[addMessageLabel setClipsToBounds:YES];

Swift

addMessageLable.layer.cornerRadius = 5.0addMessageLable.layer.masksToBounds = true//oraddMessageLable.layer.clipsToBounds = true