Reputation: 452
I have a UIView for which I set a cornerRadius property alone. The UIView updates its corners. But say I have a UILabel for which I set cornerRadius property alone without clipsToBounds, it does not work. Both are of type UIView, then why does it not work for UILabel
Upvotes: 1
Views: 295
Reputation: 77486
Internally, UILabel
has more than one layer... UIView
does not.
You can use either:
myLabel.clipsToBounds = true
or
myLabel.layer.masksToBounds = true
Upvotes: 2