How to set the custom border color of UIView programmatically?

后端 未结 10 505
情书的邮戳
情书的邮戳 2020-12-23 02:29

I am trying to set the custom border color of UIView programmatically in Swift.

10条回答
  •  自闭症患者
    2020-12-23 03:18

    If you Use Swift 2.0+

    self.yourView.layer.borderWidth = 1
    self.yourView.layer.borderColor = UIColor(red:222/255, green:225/255, blue:227/255, alpha: 1).cgColor
    

提交回复
热议问题