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?
I have tried the below one and i got an successful output.
Is there something else which is stopping you?
Add the below two line and check it.
OR
My issue was a bit different.
While I did do
btn.clipsToBounds = true
I wasn't setting doing:
Because I had different screen sizes. Instead I followed this answer and did:
It wasn't working because I forgot to add
super.layoutSubviews()
. The correct code is:Make sure you are checking with appropriate Deployment target.
Set the property
clipsToBounds
to true