Search code examples
iosuiviewios7uilabelcornerradius

UIlabel layer.cornerRadius not working in iOS 7.1


I'm currently looking at a UILabel with the property addMessageLabel.layer.cornerRadius = 5.0f; On a device with iOS 7.0 installed, it has rounded corners. On a device with iOS 7.1 installed, it does not have rounded corners.

Is this just a bug with iOS 7.1?


Solution

  • Set the property clipsToBounds to true

    addMessageLabel.clipsToBounds = true