我在 View 中使用了一些标签。我想在我的 iPhone 应用程序中制作圆角标签。我使用以下代码来执行此操作,但它不起作用。我在使用该属性时遇到了一些错误。
label.layer.borderColor = [UIColor blueColor].CGColor;
label.layer.borderWidth = 4.0;
label.layer.cornerRadius = 8;
最佳答案
我遇到了同样的问题,在单元格中使用带有 backgroundColor 的 UILabel,并添加它以正常工作:
label.layer.cornerRadius=8.0;
label.clipsToBounds=YES;
关于iphone - 如何在 iphone 中使用圆角标签,UILabel Round Corners,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8530115/