我想将我的边框颜色更改为特定的十六进制颜色(#21CE99),你们能帮帮我吗?
我已经知道如何将其更改为基本颜色,例如:
_button.layer.borderColor = [UIColor greenColor].CGColor;
但我只需要这个颜色。
谢谢。
回答
How to set the custome border color of UIView programmatically in swift
最佳答案
使用 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
关于objective-c - 按钮边框颜色 - Objective C - Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34196547/