UIlabel layer.cornerRadius not working in iOS 7.1

2019-03-08 00:13发布

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?

7条回答
我只想做你的唯一
2楼-- · 2019-03-08 00:40

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;.

查看更多
登录 后发表回答