美文网首页
Label设置边框线

Label设置边框线

作者: lalala1112389 | 来源:发表于2017-11-21 16:20 被阅读0次
func setBorder(_ color: UIColor, _ width: CGFloat, _ cornerRadius: CGFloat)  {
        self.layer.cornerRadius = cornerRadius
        var frame = self.frame
        frame.size.width += 10
        frame.size.height = 20
        self.frame = frame
        self.layer.borderColor = color.cgColor
        self.layer.borderWidth = width
        self.layer.masksToBounds = true
  }

相关文章

网友评论

      本文标题:Label设置边框线

      本文链接:https://www.haomeiwen.com/subject/icywvxtx.html