I\'m creating a UILabel to which I set the background color and corner radius with the following code:
self.scoreLabel.backgroundColor = [UIColor DISRed];// cust
I was also facing the same problem. It was a silly mistake. I always forget to tick clipToBounds in case of cornerRadius.
clipToBounds
cornerRadius
So, just ticking the Clip to Bounds for UILabel in Storyboard fixed my problem.
UILabel
And yes, we need to keep the below code too:
label.layer.masksToBounds = true