我尝试使用User Defined Runtime Attributes将cornerRadius添加到UILabel
但是它没有按预期方式工作,cornerRadius没有设置,我想知道我在哪里犯了错误。我附上了它的截图,

ios - 使用用户定义的运行时属性的UILabel的cornerRadius无法正常工作-LMLPHP

帮助我解决

最佳答案

它不仅是layer.cornerRadius,而且是cornerRadius,您还需要将layer.masksToBounds设置为true

ios - 使用用户定义的运行时属性的UILabel的cornerRadius无法正常工作-LMLPHP

关于ios - 使用用户定义的运行时属性的UILabel的cornerRadius无法正常工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42152679/

10-11 11:39