【问题标题】:Button border color - Objective C - Swift按钮边框颜色 - Objective C - Swift
【发布时间】:2016-03-15 18:33:18
【问题描述】:
【问题讨论】:
标签:
objective-c
xcode
swift
layout
【解决方案1】:
_button.layer.borderColor = [UIColor colorWithRed:33.0 / 255.0 green:206.0 / 255.0 blue:153.0 / 255.0 alpha:1.0].CGColor;
【解决方案2】:
更简单
_button.layer.borderColor = [UIColor colorWithRed:0x21 / 255.0 green:0xce / 255.0 blue:0x99 / 255.0 alpha:1.0].CGColor;
【解决方案3】:
使用 SWIFT 4 的人的正确答案是:
_button.layer.borderColor = UIColor(red: 33/255, green: 206/255, blue: 153/255, alpha: 1.0).cgColor
内置 UIColors 预设或您自己的颜色:
_button.layer.borderColor = UIColor.blue.cgColor