如何在 Swift4 中将标签制作成圆圈

  • 本文关键字:标签 Swift4 ios swift
  • 更新时间 :
  • 英文 :


timerLabel是我试图将其更改为圆圈的标签。此行代码未按我想要的方式工作:

timerLabel.layer.cornerRadius = timerLabel.frame.width/2

我在这个已经被问到的帖子中找到了我的问题的解决方案:https://stackoverflow.com/a/46066815/8451094 .谢谢@elarcoiris

lblRoundDot.layer.cornerRadius = lblRoundDot.frame.width/2
lblRoundDot.layer.masksToBounds = true

最新更新