已有:
想要添加一个水平线:
swift draw horizontal line
iphone – Creating a horizontal line – Stack Overflow
ios – Swift xcode horizontal line – Stack Overflow
ios – Swift add line above to control – Stack Overflow
用代码:
var seperatorLineView:UIView let ColorSeperatorLine:UIColor = UIColor(hexString: "#DDEEFC")! self.seperatorLineView = UIView() //6.seperator line seperatorLineView.layer.borderWidth = 1 seperatorLineView.layer.borderColor = ColorSeperatorLine.CGColor constrain(seperatorLineView, loginButton) {seperatorLineView, loginButton in } |
效果是:
[总结]
画一个水平线,可以用:
let seperatorLineView = UIView() seperatorLineView.layer.borderWidth = 1 seperatorLineView.layer.borderColor = UIColor.redColor().CGColor |
即可。
转载请注明:在路上 » [已解决]swift添加一个水平线